Get 2D location from 3D point

432 views Asked by At

I have a THREE.Vector3 with location x, y, z of a mesh in the viewer. How can I get a corresponding 2D point on canvas? I would like to place something x, y at the same location where the 3D model is located in the viewer.

1

There are 1 answers

0
Augusto Goncalves On BEST ANSWER

Check the worldToClient(point) method (part of Autodesk.Viewing.Viewer3D), the point parameters is a THREE.Vector3 point in world space coordinates. Below is a piece of the documentation.

Calculates the pixel position in client space coordinates of a point in world space. See also clientToWorld().