   Eliminate z rotation component
  HY.I have gl rotation matrix 3x3 , is possible eliminate the z rotation component from the matrix?How?Thanks.   
  I think that i can do it with euler angles , but i'm not understand how.but how i can set to 0 the z rotation component with euler angles.Thanks.   ;  it is only possible if you use Euler angles and limit pitch to less than -+90 degrees. As a note you will still have the issue of pitch up and down swapping at +-90 degrees yaw unless you apply yaw first then pitch. Basically it is quite hard to avoid the issue. I have tried many tricks to avoid the issue of roll drift that plague quaternions and matrices in a 6 degrees of freedom flight model and haven't found one that works yet. My recommendation is to use Euler angles and Restrict pitch to avoid yaw flipping 180 degrees when you cross +- 90 degrees pitch. Just make sure you yaw first and pitch second.   ;  yes ,thanks david_watt78!.I'm try to explain what i would do :I have a artoolkitplus application that detect squear markers , on the ground.clearly these shape are on the ground and can't fly up or move down , then i can entry in the +90° - 90° range?I think yes.there was a lot of jittler in the solid 3d model placedon marker create by the lens error i suppose , i calibrate the camera and this jittlers are significantly less.The procedure that i must apply with euler what is?Is hard or you should addvice to me to read some documentation(and if you have a link ...)?I'm newbie in math.I hear also about quaternion, can they help me?thanks.;  basically you have 2 variables one represents the current yaw and one represents the current pitch. You would add/subtract some number of degrees to/from Yaw/Pitch then use the yaw and pitch angle to create a quaternion or matrix. so for example.if user moves mouse left   Yaw += 1.0else if user move mouse right   Yaw -= 1.0if user moves mouse up   pitch += 1.0else if user moves mouse down   pitch -= 1.0if pitch > 88   pitch = 88if pitch < -88   pitch = -88Matrix View;View.SetPosition(Position);View.Yaw(Yaw);View.Pitch(Pitch);;Quote:Original post by giugioHY.I have gl rotation matrix 3x3 , is possible eliminate the z rotation component from the matrix?Sure, it's easy. Just pull out the Z vector from the matrix (the third column), and use it as the Z vector of the result. The Y vector of the result is the world space up-vector, and the X vector of the result is the normalized cross product of the world-space up-vector and the Z vector of the matrix.   ;  thanks Sneftel and david_watt78 , two solution , but i'm not undertand all.in particulary , Sneftel , but if i would eliminate the z rotation component , why pull it up and USE AT RESULT if i would eliminate it?next i 'm understand the cross product and the related issue.Is because the z componen't isn't the up vector , and i must eliminate the changes in the up vector?But i must rotate a 3d solid , what is the up vector in  a 3d solid? the y component?is so simple?And the david solution?   ;  but , i'm not understand , is not more simple to set always a z vector of 0.,0.,1 ?why this method?Thanks   