I am trying to use rotateOnWorldAxis
to rotate my mesh object. Before I apply the rotations, the mesh has its rotation data as Euler object with rotation value for each axis.
in mesh.rotation
:
// Euler (_x: 1.5707963267948961 _y: 1.3439035240356314 _z: 3.141592653589793)
I have some angles that I would like my mesh to rotate on each axis, so I am doing the following:
// define axis vectors and angles
const xAngle = some angle in Radians
const xAxis = new THREE.Vector3(1, 0, 0);
...same for Y and Z axis
// apply rotateOnWorldAxis
mesh.rotateOnWorldAxis(xAxis, xAngle);
...same for Y and Z axis
After using rotateOnWorldAxis
method on my mesh object, I can visually see that my mesh has rotated correctly. However, when I inspect the object after applying the rotations, the mesh.rotation
property does not change and still contains values from before the rotations.
In fact, all of its properties regarding transformation (e.g., matrix
, matrixWorld
, position
, quaternion
) remain unchanged, while the rendered mesh does rotate visually.
How do I trigger my mesh object to update all of its transformation data after applying rotateOnWorldAxis
?