View Full Version : Convert Vector to....

11-08-2005, 03:03 AM
Hello !

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, 05: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) :)

11-08-2005, 07:25 PM
Hi !


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, 09: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.

11-08-2005, 10:39 PM
Thanks a lot !