I am facing an issue with a series of Object3Ds in my scene that I crafted myself using vertices and faces. The vertices of these objects can be positioned very far from the world origin, with X and Y values reaching up to around 600,000. When attempting to rotate or scale these objects, they seem to rotate around a different axis rather than their local center.
Interestingly, object3D.translateX (or Y Z) works as expected, as does simply adjusting the position:
object.position.x = 10
This updates the x position by 10 units away from the local origin at 0,0,0.
I am unsure which axis the object is rotating around. Even when I moved the geometry to 0,0,0 using object.position, it did not rotate around its center either.
If it helps, I have code to determine the center of the object using:
THREE.Box3().setFromObject(object).center
(although there may be better methods available))
I came across this post which showed me how to rotate (XYZ) around the central point, but I am struggling to find a way to rotate around individual X, Y, Z axes separately.
Are there any solutions for this common problem of scaling and rotating objects around their central axes?
Edit: I have found conflicting information indicating that rotation should occur around a local axis, but this doesn't seem to apply to my geometries! Some sources suggest rotation occurs around the object axis
Similarly pointing out similar issues, suggesting it might vary based on how the object is 'built' (unclear what that means)