Show differencesHistory of post edits
#Actuallukesmith123
Posted 17 March 2012 - 08:49 PM
EDIT: Ah I realised I had made a stupid mistake elsewhere and the code that I originally posted was fine. Sorry!
#2lukesmith123
Posted 17 March 2012 - 08:41 PM
thanks for the reply. I realised I only really needed the rotation around the Y axis so I could just use arctan to deterime the rotation based on the vector.
#1lukesmith123
Posted 17 March 2012 - 08:07 PM
I am only really interested in the rotation around the Y axis from the direction.
I read on a forum thread that I can use atan2(direction.x, direction.z); to determine the Y axis rotation.
However when I do this the object faces in a particular direction no matter what values I put in direction.x and direction.z.
Hopefully somebody can help me here as I getting really confused.
I read on a forum thread that I can use atan2(direction.x, direction.z); to determine the Y axis rotation.
However when I do this the object faces in a particular direction no matter what values I put in direction.x and direction.z.
Hopefully somebody can help me here as I getting really confused.