Jayy
Jayy

Reputation: 14728

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

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

Upvotes: 16

Views: 11334

Answers (1)

WestLangley
WestLangley

Reputation: 104763

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

Upvotes: 21

Related Questions