Given this transformation matrix, how do I decompose it into translation, rotation and scale matrices?

I have this problem from my Graphics course. Given this transformation matrix:

(212211001)

I need to extract translation, rotation and scale matrices.
I’ve also have the answer (which is TRS):
T=(102011001)R=(1/21/201/21/20001)S=(2/200020001)

I just have no idea (except for the Translation matrix) how I would get to this solution.

Answer

I am a person from the future, and I had the same problem. For future reference, here’s the algorithm for 4×4. You can solve your 3×3 problem by padding out your problem to the larger dimensions.

Start with a transformation matrix:[abcdefghijkl0001]

  1. Extract Translation
    This is basically the last column of the matrix:t=<d,h,l>While you’re at it, zero them in the matrix.

  2. Extract Scale
    For this, take the length of the first three column vectors:sx=

  3. Extract Rotation
    Divide the first three column vectors by the scaling factors you just found. Your matrix should now look like this (remember we zeroed the translation):
    \begin{bmatrix}
    a/s_x & b/s_y & c/s_z & 0\\
    e/s_x & f/s_y & g/s_z & 0\\
    i/s_x & j/s_y & k/s_z & 0\\
    0 & 0 & 0 & 1
    \end{bmatrix}
    This is the rotation matrix. There are methods to convert it to quaternions, and from there to axis-angle, if you want either of those instead.

resource

Attribution
Source : Link , Question Author : metavers , Answer Author : imallett

Leave a Comment