What's the rotation matrix needed to align a rhombic dodecahedron such that six of its contact points line up to form a hexagon?

96 Views Asked by At

enter image description here

I want to know what the rotation matrix is I need to make this mesh have a hexagonal shape from a top-side orthographic viewpoint. The point where it has at least something resembling this is when viewing through an axis moving through points [.5, .5, .5] and the origin, shown here.

enter image description here

Obviously the fastest solution would be to rotate .5,.5,.5 to 1, but I also want to make sure it's rotated at an angle where one of the other points aligns with an X or Y axis.

I also probably forgot how to rotate source points to destinations.

This should be a simple question but I can't really find the answer here.

1

There are 1 best solutions below

0
On BEST ANSWER

If the eight threefold vertices are $$(\pm 0.5, \pm 0.5, \pm 0.5),$$ and the six fourfold vertices are $$(\pm 1, 0, 0), (0, \pm 1, 0), (0, 0, \pm 1),$$ then a rotation that maps $v_1 = (0.5, 0.5, 0.5)$ to $v_3 = (0, 0, \frac{\sqrt{3}}{2})$ will work. A rotation about the $z$-axis by $\pi/4$ radians transforms $v_1 = (0.5, 0.5, 0.5)$ to $v_2 = (0, \frac{\sqrt{2}}{2}, 0.5)$. Then we require a rotation about the $x$-axis by an angle $\varphi$ that satisfies $$\cos \varphi = \frac{v_2 \cdot v_3}{|v_2||v_3|} = \frac{1}{\sqrt{3}}.$$ So the complete rotation matrix is $$\begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \varphi & -\sin \varphi \\ 0 & \sin \varphi & \cos \varphi \end{bmatrix} \begin{bmatrix} \cos \frac{\pi}{4} & -\sin \frac{\pi}{4} & 0 \\ \sin \frac{\pi}{4} & \cos \frac{\pi}{4} & 0 \\ 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} & 0 \\ \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{6}} & - \sqrt{\frac{2}{3}} \\ \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} \end{bmatrix}.$$