THREE.js: Calculate world space position of a poin

2019-01-18 05:13发布

问题:

I have a 3D object. "Attached" to it is a point. When the object is moved or rotated, the point moves and rotates with it.

Given the object's position and rotation, how can the position of the point in world space be calculated? (Using THREE.js's API if possible)

Thanks

回答1:

For a point in an object's local coordinate system,

object.localToWorld( point );

will return the world coordinates of the point, assuming the same transform is applied to the point as is applied to the object.

three.js r.55