# Transform Matrix multiplication order

I am experiencing difficulties trying to figure out the correct multiplication order for a final transform matrix. I always get either strange movement or distorted geometry. My current model is explained below:

For a single node my multiplication order is:

L = S * R * T

where

L = local transformation matrix

S = local scale matrix

R = local rotation matrix

T = local translate matrix

For a node's world transformation:

W = P.W * L

where

W = world transformation matrix

P.W = parent world transformation matrix

L = the local transformation matrix calculated above

When rendering, for each node I calculate the matrix :

MV = Inv(C) * N.W

where

MV = the model view transformation matrix for a particular node

Inv(C) = the inverse camera transformation matrix

N.W = the node's world transformation matrix calculated above.

Finally, in the shader I have the fallowing transformation:

TVP = PRP * MV * VP

where

TVP = final transformed vertex position

PRP = perspective matrix

MV = the node's world transformation matrix calculated above

VP = untransformed vertex position.

With the current model, child nodes which have local rotation, rotate strangely when transforming the camera. Where did I go wrong with the multiplication order?

• Just to note something here for any newcomers. The OP assumes right-handed conventions. Oct 13 '20 at 11:32

Any combination of the order S*R*T gives a valid transformation matrix. However, it is pretty common to first scale the object, then rotate it, then translate it:
L = T * R * S