Get Relative transformation from absoulte transformation
Hi,
i have the absolute transformation matrix of the joints of a skinned mesh.
Is it possible to compute the relative transformation of each joint (relative to theit parent) ? is yes, how ?
Thanks.
Yes, that's possible. The following is assuming that you transform vertices from one space to another by using the order Matrix * Vector. (If you use the form Vector * Matrix, do the multiplications below in the opposite order)
Suppose you have the hierarchy O - B1 - B2, for 'Object space', 'Bone 1 space', 'Bone 2 space'. That is, B1 is the parent node of B2, and B2 is the leaf bone node. Also, you've got the following matrices:
Now, to compute the relative matrices, you just do:
In general, if you've got a transformation matrix M from space A to space B, then M^-1 will be the transformation matrix from space B back to space A.
You can think of the example above like follows:
And always remember your multiplication order based on your convention whether you go M*v or v*M.
Suppose you have the hierarchy O - B1 - B2, for 'Object space', 'Bone 1 space', 'Bone 2 space'. That is, B1 is the parent node of B2, and B2 is the leaf bone node. Also, you've got the following matrices:
wO: The matrix to transform from the object local space to world space.wB1: matrix from B1 space to world space.wB2: B2 space -> world space.
Now, to compute the relative matrices, you just do:
wO^-1 * wB1 = B1: The matrix from bone1 local space to the object local space.wB1^-1 * wB2 = B2: The matrix from bone2 local space to the bone1 local space.
In general, if you've got a transformation matrix M from space A to space B, then M^-1 will be the transformation matrix from space B back to space A.
You can think of the example above like follows:
wB1^-1 * wB2 = B2->World followed by Inverse(B1->World) = B2->World followed by World->B1 = B2->B1
And always remember your multiplication order based on your convention whether you go M*v or v*M.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement