Original Post
There-s been an article, "360 degree rotation..HELP" a long time ago, posted by Jehsup. The fragment of code posted was: void CAMERA::ComputeNewView( float deltaTime ) { if( ( Yaw>=360.0f) || ( Yaw<=-360.0f ) ) Yaw = 0.0f; if( ( Pitch>=360.0f) || ( Pitch<=-360.0f ) ) Pitch = 0.0f; if( ( Roll>=360.0f) || ( Roll<=-360.0f ) ) Roll = 0.0f; float cosYaw = (float)cosf( DEG_TO_RAD( Yaw ) ); float sinYaw = (float)sinf( DEG_TO_RAD( Yaw ) ); float sinPitch= (float)sinf( DEG_TO_RAD( Pitch ) ); float cosPitch= (float)cosf( DEG_TO_RAD( Pitch ) ); float cosRoll = (float)cosf( DEG_TO_RAD( Roll ) ); float sinRoll = (float)sinf( DEG_TO_RAD( Roll ) ); vecForward[0]= sinYaw; vecForward[1]= sinPitch; vecForward[2]= cosPitch * -cosYaw; vecForward.Normalize(); vecUp[0] = sinRoll; vecUp[1] = cosRoll * cosPitch; vecUp[2] = sinPitch; vecUp.Normalize(); vecSide= vecForward.CrossProduct( vecUp ); vecSide.Normalize(); vecLookAt= vecEyePos + vecForward; //check DOT Product outputs are 90 degrees apart dot_up_side = m_vecUp.DotProduct(vecSide); dot_up_forward = m_vecUp.DotProduct(vecForward); dot_forward_side = m_vecForward.DotProduct(vecSide); }// end CCAMERA::ComputeNewView What i am interested is what are the math formula for: vecForward[0]= sinYaw; vecForward[1]= sinPitch; vecForward[2]= cosPitch * -cosYaw; vecForward.Normalize(); vecUp[0] = sinRoll; vecUp[1] = cosRoll * cosPitch; vecUp[2] = sinPitch; I also know that the rotation matrix is calculated like the rotation around all the three axes: [Cf] = Rz * Ry * Rx * [C] => „¡ „¢ „¡ „¢„¡ „¢„¡ „¢„¡ „¢ „ xf „ = „ cz -sz 0 0 „ „ cy 0 sy 0 „ „ 0 0 0 0 „ „ x „ „ yf „ „ sz cz 0 0 „ „ 0 1 0 0 „ „ 0 cx -sx 0 „ „ y „ „ zf „ „ 0 0 1 0 „ „ -sy 0 cy 0 „ „ 0 sx cx 0 „ „ z „ „ 1 „ „ 0 0 0 1 „ „ 0 0 0 1 „ „ 0 0 0 1 „ „ 1 „ „¤ „£ „¤ „£„¤ „£„¤ „£„¤ „£ „¡ „¢ „¡ „¢„¡ „¢ „ xf „ = „ cy*cz sx*sy*cz-cx*sz cx*sy*cz+sx*sz 0 „ „ x „ „ yf „ „ cy*sz sx*sy*sz+cx*cz cx*sy*sz-sx*cz 0 „ „ y „ „ zf „ „ -sy sx*cy cx*cy 0 „ „ z „ „ 1 „ „ 0 0 0 1 „ „ 1 „ „¤ „£ „¤ „£„¤ „£ I do not understand, if vecForward is against z axis, and the vecUp is along y axis, it does not make sense to me. Thank you for any help, in advance.