Convert Vector to....

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. )

Thanks.

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) :slight_smile:

Hi !

Thanks.

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.

Thanks.

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.

Thanks a lot !

:cool: