Recent versions of Three.js (v50+) provide this functionality built into the THREE.Object3D
class. In particular, to get the world coordinates of a local THREE.Vector3
instance named vector
, use the localToWorld
method:
object.localToWorld( vector );
Similarly, there is a worldToLocal
method for converting world coordinates into local coordinates, which is slightly more complicated, mathematically speaking. To translate a world vector
into the objects local coordinate space:
object.worldToLocal( vector );