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
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
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
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
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?