So I\'ve got an object I\'m trying to rotate according to a Yaw, Pitch and Roll scheme, relative to the object\'s own local axes rather than the global space\'s axes. Accor
Your problem is that you are storing your x, y, z rotations and adding to them cumulatively. Then when you render you are performing the total cumulative rotations upon the identity matrix(you are performing all rotations globally). Comment out your identity call from your render loop. And make sure you set identity at your initialize function. Then
rotate as normal
m_Rotation.x = m_Rotation.y = m_Rotation.z = 0.0f;
//clear your rotations you don't want them to accumulate between frames
glpush
translate as normal
(all other stuff)
glpop
//you should be back to just the rotations
//glclear and start next frame as usual
As I'm sure you found out after you accepted the original answer. The order of rotations or translations does not affect which axis the rotation occurs on, rather the point at which the rotation is performed. eg rotating a planet 15 degrees will rotate it on the global axis 15 degrees. Translating it away from origin and then rotating it will cause it to orbit the origin at the distance translated (if on the same axis as the rotation, translating on the x axis then rotating on the y axis would not have any confounding effects).