For example, a first rotation of 180° about the X axis, and a 2nd rotation of 180° about the Z axis will produce the following result:
Now, i need to tween back the 3D object to the initial rotation, e.g. to 0,0,0 degrees.
Briefly, the 3D figure shall be return to its initial position. In this example, the shortest way would be to apply to the figure a 180° rotation about the Y axis.
How can i determine the shortest way, starting from an arbitrary rotation, and then calculate a certain number of intermediate rotation angles to smoothly animate the movement of the 3D figure?
Is this a problem of decomposing a rotation matrix back to Euler angles, or could be this accomplished with pure matrix math? Should i keep track of the applied rotation angles? I have really no idea from where to start.