Angle between object and camera?

Get a question: How can I track the angle between object and camera in Babylon? Thanks!

You can use the GetAngleBetweenVectorsOnPlane function for that, but you have to choose a plane to project the vectors onto to calculate the angle between them. Here’s an example using the Y axis for the projection plane. :slight_smile:

const angle = BABYLON.Vector3.GetAngleBetweenVectorsOnPlane(camera.position, mesh.position, BABYLON.Axis.Y);
3 Likes