I am attempting to change the orientation of a mesh that has been loaded into an Object3D
using OBJMTLLoader
.
var obj = new THREE.Object3D();
// loading process...
obj.rotation.y += 0.1; //executed within the update function
This method works correctly for the y and z axes. However, when I try to apply the same approach to the x axis, it results in rotation similar to the z axis, but in a clockwise direction rather than counterclockwise.
My requirement is to rotate the object along the x-axis.
var xAxis = new THREE.Vector3(1,0,0);
obj.rotateOnAxis(xAxis, 0.1);
The above code effectively rotates the object along the x-axis.
Nevertheless, I am interested in animating the rotation of the object using tweens. Thus, I need a method to precisely set the angle by which the object should be rotated, instead of applying a fixed amount of rotation.
Why do obj.rotation.y
and obj.rotation.z
produce desired results, while obj.rotation.x
does not?