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


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 !


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.


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 .

For a good example, check .

You could just copy/paste the example, but understanding how it works allow you to adapt it to your neededing.

Thanks a lot !