https://threejs.org/docs/#api/en/core/Object3D.position
According to the docs above
- .translateX “Translates object along x axis in object space by distance units”
- .position storse “A Vector3 representing the object's local position” and
- .rotateX “Rotates the object around x axis in local space”.
So all these methods/attributes refer to the local coordinate system of the object. And that is what I’m not understanding.
I rotated an object with .rotateX(2). Then I applied .translateY(2). The result was the following:
The .rotation propertie contain the following: .rotation
The matrixWorld looks like this: .matrixWorld
And the position attribute contains: .position
So I would expect that the position attribute contains x: 0, y: 2, z: 0 because the docs says that the .position is in local coordinate and the translate-method works also in local coordinates. But to me it looks like .translate works indeed in the local coordinates but .position stores the position not in local coordinates but in world-coordinates. What supports this view is the fact that the values exactly match the values in the last column in the WorldMatrix.
So I'm confused and would ask if somebody can explain to me why the docs say something different than what I would expect.