View Full Version : Convert Vector to....
Could you please tell me how to convert a VECTOR to a QUATERNION ?
( I just need the QUATERNION with PITCH & YAW. I don't need the ROLL. )
11-08-2005, 06:15 AM
You can't convert a vector to a quaternion, they are totally different things. If you mean converting your vector based rotations to quaternions, you should glGoogle(opengl quaternion rotation) :)
Given a Vector, ( which has some 'theta' with respect to XZ-PLANE & some 'phi' with respect to XY-PLANE ), we can have PITCH, YAW & ROLL(=0. i.e we assume it to be 0) and convert these angles ( EULER angles ? ) to a QUATERNION.
How do I get a quat ?
Looking forward to your reply.
11-08-2005, 10:48 PM
Explaining it would be too long, and as I said there are MANY quaternions tutorials available.
For an understanding on using quaternions for rotations, you should check http://www.gamedev.net/reference/articles/article1095.asp .
For a good example, check http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Quaternion_Camera_Class .
You could just copy/paste the example, but understanding how it works allow you to adapt it to your neededing.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.