3D Rotations with Quaternions
I am having trouble with rotating models using quaternions/matrices.
The model has three vectors to determine which way it is facing and a quaternion to store the rotation of the model. It also has a vector to store its position.
When I rotate the model around the x axis the direction vector rotates clockwise and the quaternion rotates anti-clockwise.
If I use negative x values for the direction vector then when I rotate the model around the y axis sometimes the vector and the quaternion rotate the same way and some times opposite ways.
Can anyone give me any ideas as to why this happens?
Thanks a ton - Gareth
I assume your 3 facing vectors are an up, facing and side vector for the model. Try negating your side vector (usually calculated from a cross-product, just do it the other way around because aXb = -bXa) to flip the "handedness" of the resulting orientation vectors.
Either that or use the quat conjugate q* = (w, -x, -y, -z) in the quat part.
Don''t try both at once though because they should cancel each other out!
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Either that or use the quat conjugate q* = (w, -x, -y, -z) in the quat part.
Don''t try both at once though because they should cancel each other out!
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement