I want to rotate a 3D cube using a 3x3 matrix. I manage to get the matrix but OpenGL needs a quaternion to rotate the cube using
glRotatef (float angle, float x, float y, float z);
How can I go from a 3x3 matrix to a quaternion to use this method properly ?
Thanks!
glRotatef
doesn't expect a quaternion, but an axis and angle (in degrees). Have a look at:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm