Looking to rotate a globe object around its y-axis smoothly? I have come across a helpful function for achieving this:
function rotateAroundObjectAxis(object, axis, radians) {
var rotationMatrix = new THREE.Matrix4();
rotationMatrix.makeRotationAxis(axis.normalize(), radians);
object.matrix.multiply(rotationMatrix);
console.log("object matrix: " + object.matrix.elements);
object.rotation.setFromRotationMatrix( object.matrix );
}
However, I've noticed that the rotation halts at a certain point. This could be due to the fact that the value of object.matrix, which is utilized in the matrix multiplication process with my calculated rotation matrix, becomes <= 0. How can I ensure a continuous and seamless rotation?
I appreciate any guidance you can provide. Thank you!