THREE.js: Calculate world space position of a point on an object

CL22 picture CL22 · Feb 13, 2013 · Viewed 9.1k times · Source

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

Answer

WestLangley picture WestLangley · Feb 13, 2013

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