Hi everyone,

if given a matrix multiplied by three matrix: scale, rotation and translation, how to decompose it to get the three original matrix? Thank you in advance.

It may be like this:

matScale =

| S 0 |

| 0 1 |

matRotattion =

| R 0 |

| 0 1 |

matTranslation =

| A 0 |

| T 1 |

A is the identified matrix.

matScale x matRotattion x matTranslation =

| SxR 0 |

| T 1 |

Now I can get the matTranslation, but how to get matScale and matRotattion from SxR ?

OK, strip out the translation from your composite result matrix.

If the scale is uniform I think this will work - pass a unit vector [1,0,0] for example into your composite result matrix matrix, and normalize it to find the incoming scale. Then scale the composite matrix by 1/scale. I *think* you’ll be left with the original rotation matrix.

If the scale isn’t uniform this is highly unlikely to work!

Thank you! I will try it.

Note, when I said ‘normalize’, I *actually* meant determine the radius - if your vector [1,0,0] comes out as [0.5, -0.8, 0.9 ] the implication is a scale of 1.3038, so multiply the matrix by 0.767 to get the original rotation.