I have a 3D cube, 8 3D point cordinates, whose center is $(0,0,0)$, and is rotationally distorted. I want to calculate the angles, $R_x, R_y, R_z$ for rotation to rectificate the cube.
3D coordinates, $(x,y,z)$'s, of a sample cube:
p0 = (0,4482, 0,6137, 0,4153) p1 = (0,1041, 0,6839, -0,5210) p2 = (0,7758, -0,3119, 0,2255) p3 = (0,4317, -0,2417, -0,7108) p4 = (-0,4317, 0,2417, 0,7108) p5 = (-0,7758, 0,3119, -0,2255) p6 = (-0,1041, -0,6839, 0,5210) p7 = (-0,4482, -0,6137, -0,4153)
which looks something like:
(the camera is at the point $(0,0,2)$ and looks to the point $(0,0,0)$)
I created 3 vectors using coordinates of the Cube, $V_x', V_y', V_z'$, $p_0 - p_1, p_0 - p_2, p_0-p_4$ these 3 vectors have some angles with the real world axis', $V_x, V_y, V_z$.
I know how to use dot product, however, using classical dot product does not give me the true rotation angles, $R_x, R_y, R_z$, and indeed I know the ordering of the rotation is important, (i.e., rotate X axis 30; rotate Y axis 40;
is not the same as rotate Y axis 40; rotate X axis 30;
).
My question is using the coordinate system of the cube, $V_x', V_y', V_z'$ and using the real coordinate system, $V_x, V_y, V_z$, $[1,0,0], [0,1,0],[0,0,1]$, how can I come up with the $R_x, R_y, R_z$ angles such that when I rotate all the points of the cube using $R_x, R_y, R_z$, respectively, the cube will be rectified (i.e., $V_x$ and $V_x'$, $V_y$ and $V_y'$, $V_z$ and $V_z'$ will be one after the other) ?
Or if my current approach is wrong, how can I come up with the angles, $R_x, R_y, R_z$, using $p_0, p_1, \ldots, p_7$ ?