• Advertisement
Sign in to follow this  

Quaternion problem

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I always used euler angles to represent rotations, as they are really easy to manage. Now I'm switching to quaternions, as they are much more powerful (smooth interpolation, no gimbal lock etc). The problem is, if I use quaternions to store the rotation of my entities, how can I, say, position a camera behind an entity? With euler angles, you just end up with some sin/cos math and you have it, but I have no idea on how to implement this with quaternions.. Is there an easy way to convert a quaternion back to euler angles? Or should I keep using euler angles, and use quaternions only where they are really needed (camera interpolation when looking at something)?

Share this post


Link to post
Share on other sites
Advertisement
One possibility would be to set the camera up initially using a matrix and then convert the matrix to a quaternion. From there, it seems that you could keep the camera oriented correctly with relative rotations, using the quaternion directly (i.e. with slerp, RotationArc(), etc.).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement