# 2D vector to Quaternion

I have a 2D vector (with only X and Y), and my engine only supports orientation through Quaternions.

How do I translate a 2D vector to a quaternion?

The X and Y represent the direction (so X = 0 and Y=1 means going forward, X=0.707 and Y=0.707 means rotate 45 degree, etc).

• What library is it? Are you sure it doesn't have any interchange methods? – Seth Battin Jul 29 '13 at 21:07
• Ogre3D, and I have no idea what methods to use – Pacha Jul 29 '13 at 21:13

void Ogre::Quaternion::FromAngleAxis(

Your rkAxis will always be UnitZ, because you are constraining yourself to the X-Y plane.