I am developping some kind of basic 3D modeller which imports various formats and exports to my own format for my own viewer (my format is quite OpenGL-oriented as you can imagine !).
I wanted to implement in the modeller the kind of rotation you have in 3D Studio Max.
Basically, the object will always rotate around the world axes…
But I am stuck on how to reproduce that !
I wanted to keep track of the X_Angle,Y_Angle,Z_Angle and then use the 3 different rotation matrices to obtain the full rotation matrix. Of course it does not work (OK, I should have thought about that before !).
Let me explain… I wanted to use three rotations around X,Y,Z. I had three matrices Rx,Ry,Rz and I thought RxRyRz=R would be my final matrix… The problem is that when I apply Ry, it applies to my world coordinates system transformed by Rz !
Does anyone know how I can rotate my object about any of the X,Y,Z of the WORLD coordinates system ???
Just some precision : at the moment, for each object, I have a GLfloat m_TransformMatrix (loaded with glLoadMatrix when rendering) and I keep track of the m_XRotationAngle, m_YRotationAngle and m_ZRotationAngle…
I am not afraid of complicated maths so you can go !
I would prefer an algorithm on how to build the transformation matrix based on my 3 angles but if I must use Euler angles and/or quaternions, please tell me !
Hope someone can save my life !!!