Original Post
Hi,
I have a camera thats using a quaternion to represent the orientation.
From this quaternion im retrieving the up, right and direction vectors, like this:
Matrix m;
m_orientation.ToMatrix( m );
m_up = Vector3f( mat._12, mat._22, mat._32 );
m_up.Normalize();
m_right = Vector3f( mat._11, mat._21, mat._31 );
m_right.Normalize();
m_direction = m_right.Cross( m_up );
m_direction.Normalize();
When i''m still the direction is ( 0, 0, 1 ) as expected. Going down 90 deg gives me a direction of ( 0, -1, 0 ) which is fine. But if i''m rotating 90 deg to the right ( 1, 0, 0 ) and then going down 90 deg gives me a direction of ( 1, 0, 0 ) instead of ( 0, -1, 0 ) ??.
I this a gimbal lock problem??
What im i doing wrong ?
Can i retrieve the up, right, direction from the quaternion directly instead of using matrix math ?
Cheers,