0
$\begingroup$

I have two objects A and B, with a start transformation matrices MA1 and MB1 (they include translation, rotation and scale). End matrix of the first object is MA2. How do I apply the same rotation as a rotation of object A from MA1 to MA2 ( difference) to object B and get MB2?

$\endgroup$

1 Answer 1

0
$\begingroup$

First you extract rotation matrix from transformation matrix. You take top-left 3×3 submatrix $T$ and use polar decomposition to find rotation matrix $U$. If you know that scale is the same on all axes, then you can just divide $T$ by cubic root of determinant: $U=T/\sqrt[3]{\det T}$.

Finally, $U_{1\to2} = U_{A2} U_{A1}^{-1}$

$\endgroup$
1
  • $\begingroup$ I have the problem in the final step. I use B1 *(U1→2)^-1 for object B and this looks like it applies the rotation U1→2 to object B around the object's B coordinate system. It works as needed if MA1 is identity. $\endgroup$
    – pazduha
    Dec 20, 2018 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .