15

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

Jodes
  • 14,118
  • 26
  • 97
  • 156
  • Leaving a note here in case it helps others. The marked answer didn't operate as I expected (this is probably a me issue). But I eventually found what I thought it was asking for - ie, the ".getWorldPosition" method. Ref here: https://stackoverflow.com/questions/15098479/how-to-get-the-global-world-position-of-a-child-object – Wide Awake Aug 08 '23 at 11:29

1 Answers1

20

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

WestLangley
  • 102,557
  • 10
  • 276
  • 276