In my current project, I have created an extensive array of objects centered around a focal point within a scene. My goal is to manipulate these objects along their local axes. Initially, I aligned all the objects to face the origin by using a reference object and the lookAt() method. Then, to ensure correct alignment of the other axes, I followed this specific method. This method worked perfectly for setting the initial rotation. However, when attempting to rotate these objects dynamically using
object.rotation.x = <amount>
, the rotations do not adhere to the local axis of the object.
Adding to the confusion, the rotations don't seem to follow the global axis either. It appears that the rotation is based on an unexpected set of axes. To showcase this issue, I have prepared a demonstration in a JSFiddle here. In the provided example, you can observe that the looker.rotation.z
behaves correctly by rotating along the Z axis as intended. However, changing it to X or Y does not result in rotations along the local or global axes. If anyone can shed light on why this behavior occurs, it would be greatly appreciated.