My dilemma involves a box located in the global axis system XYZ. I am trying to rotate this box to align with a new axes system X'Y'Z'
The vectors for the new axes are:
X' = (0,1,0)
Y' = (1,0,0)
Z' = (0,0,-1)
This information gives me the rotation matrix:
0,1,0
1,0,0
0,0,-1
To achieve the desired orientation of the box mesh like so: https://i.sstatic.net/tQTAJ.jpg
I initially attempted to apply Euler angles for rotation but encountered issues where no rotation was apparent when using the following code:
let box = new Three.BoxGeometry(w, h, thickness);
const material = new Three.MeshBasicMaterial({...});
const mesh_box = new Three.Mesh(box, material);
mesh_box.rotation.x = -Math.PI/2;
mesh_box.rotation.y = 0;
mesh_box.rotation.z = Math.PI;
I made use of the asin and atan2 formulas outlined in chapter 2.1 on page 4 of this document: to calculate Euler angles.
Upon further investigation, I realized that the rotation is simply around the X/Y/Z axis and requires correct order placement.
In determining the ideal angle placements for each axis X/Y/Z based on the known rotation matrix, I used the calculations:
alfa = -1.57
beta = 0
gamma = 3.14
How can I determine which angle corresponds to each axis X/Y/Z?