I've got a set of $N$ points $p_1,\dots,p_N$ that all belong to a real object. Consequently, there are $N-1$ vectors $\vec{v}_i$ when $\vec{v}_i$ points from $p_1$ to $p_i$.
Now, the object is rotated in some unknown way. $p_1$ stays in the same place (= no translation, just rotation), but all other points are now at their new location $p'_i$ - which means that the vectors also changed to $\vec{v}'_i$ (same length, but different directions).
I know all $p, p', \vec{v}$ and $\vec{v}'$ - using these values, how can I express the rotation via a rotation matrix?
I've tried to use cross-product to get the rotation axis and the scalar-product to get the rotation angle for a single vector, which enables me to compute a rotation matrix - but if I use different vectors I get different results!?
This is the way I do this:
$\vec{a} = \frac{ \vec{v_2}\times\vec{v}_2' }{ |\vec{v_2}\times\vec{v}_2'| }$ $c = \frac{ \vec{v_2} * \vec{v}_2' }{ |\vec{v_2}| \cdot |\vec{v}_2'| }$ $s = sin(cos^{-1}(c))$ $t = 1 - c$
With these values, the rotation matrix is (according to this website):
R = \left( \begin{matrix} t*x*x + c & t*x*y - z*s & t*x*z + y*s\\ t*x*y + z*s & t*y*y + c & t*y*z - x*s\\ t*x*z - y*s & t*y*z + x*s & t*z*z + c \end{matrix} \right)
(with $\vec{a} = (x,y,z)^T$)
Thank you for any thoughts on this!