Original Post
Hello! I have a screen graph and I need to store a local and world transformation at each node. I want to write a class Transformation, which stores a transformation in a certain way. The only transformations I need is Scaling, Rotation and Translation. There is one additional requirement: Since I want to "animate" the objects I need a system which allows me to easily modify any of the transformations (scaling or rotation or translation). So I guess I can't just store the final composition matrix M in class Transformation, because there is no way to extract one transformation type. For example: Assume M = Rotation1 * Scaling * Rotation2 * Translation * Rotation3; I think its generally impossible to modify each single transformation if I just have M (for example I can't extract the scaling in every case to modify it). My second idea was to store the transformations in a list: std::list transforms. This way I could store arbitrary transformations AND could access each of them seperately. For example if I want to modify the scaling I would just modify transforms[1]. But the problem is: its tedious to remember where which matrix is stored. Now my last idea and basically the reason for this thread: I saw an engine which stores a composition of transformation in this way: R*S*T. So it just stores 3 matrices (rotate, scale, translate) and the order is always rotation, then scaling, then translation. This is easy and I can access every transformation easily but I think I can't express every transformation with this fixed order. Assume I want to do this: I want to rotate a box around the world y-axis and the box has to rotate around its own axis. This would basically lead to this transformation: Scale * Rotate1 * Translate * Rotate2, where Rotate1 express the rotation around the box axis and Rotate2 the rotation about the world y-Axis. Now I wonder if I can express EVERY possible transformation (composed of scale,rotate,translate) with this fixed matrix order: S * R_2 * T * R_2 (scale, rotation1, translation, rotation2) ? Thanks for any help!