Extracting transformation between 2 transformation matrices

68 Views Asked by At

I have a hierarchy of bones and final transformation matrices for each bone. My question is, is there a way to extract the transformation (rotation in euler angles and translation) between 2 matrices (belonging to parent and child bones)?

I have tried multiplying parent's inverse with child's transformation but decomposed transformation data was incorrect.

1

There are 1 best solutions below

1
On BEST ANSWER

Let's say you have torso with transformation $T_0$ (a bend) and a hand with final transformation $T_1$ (raising hand). That implies that a point $v_0=(x,y,z,1)^T$ belonging to torso in reference coordinates will have global coordinates $T_0v_0$ and the same for the hand $T_1v_1$.

Let $M$ be tranformation between torso and hand, then $$ T_1 = T_0M, $$ because both transformations are given in local coordinates (our model raises hand first and then bends). Thus, $M=T_0^{-1}T_1$.

Finally, tranformation matrix $M$ consists of rotation matrix part and translation vector. Finding Euler angles from rotation matrix is a well-known problem.