# Matrix transformation

I have to find components of a matrix for 3D transformation. I have a first system in which transformations are made by multiplying: M1 = Scale x Rotation x Translation. I want to have the same transformations in an engine who compute like this: M2 = Scale x Translation x Rotation So when I enter the same values there's a problem du to the inversion of translation and rotation.

How can I compute the values in the last matrix M2 for having the same transformation?

Thanks

If you multiply the translation vector by the inverse of the rotation matrix, you'll get an "anti-rotated" translation which you can use to swap the order. The "anti-rotated" translation will get turned back into the original translation when the rotation matrix is applied.

However, are you sure you understand correctly what the second engine is doing? Scale * Translation * Rotation makes no sense as a local-to-world transform, as objects would be rotated about the world origin rather than their own local origin. Perhaps this engine supports different scale and rotate pivots, and the translation you're seeing is from the scale pivot to the rotate pivot? That's the only reason I can think of to place a translation between a scale and a rotation.

• Thanks a lot. It was very helpfull. In fact, this transformation was for UV space and object space. – Mayhem50 Jun 27 '14 at 12:33