how to find the pivot/axis and angle that move one coordinates space to another?

252 Views Asked by At

I am writing a plugin for a 3d modeler, and I am stuck. For my plugin, I need to get the axis and the angle used for rotating a 3d object.

But I only get the coordinates (~ 3dmatrices) of the objects before and after the rotation. And It seems there is no singular solutions.

Am I correct or is there something I missed ?

1

There are 1 best solutions below

0
On

If $A$ is the matrix of the rotation (whose $i$-th column contains the coordinates of $Ae_i$, $e_i = (0,...,1,...,0)$), then its axis is directed by a non-zero vector $v$ satisfying $Av = v$, i.e. $$(A-I)v = 0$$ where $I = \begin{bmatrix} 1 & 0& 0\\ 0&1&0\\0&0&1\end{bmatrix}$.