Sign in to follow this  
Arcibald Wearlot

Quaternion problem

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
jyk    2094
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this