It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that when the Messenger of Allah (peace and blessings be upon him) travelled and intended to offer voluntary prayer, he would turn his mount towards the qiblah, then say the takbir, and then continue his prayer in whichever direction the she-camel faced.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2208