Create hotspot front of camera

Hi

I working in on babylon js, I have load module. I want to add hotspot in front of camera. so how I create hotspot front of camera.

I am get camera current position. but not get camera angle.

Please hlep me

1 Like

Do you ask how to let TransformNode/Mesh stay (move & rotate with) infront of camera?

PG:

Or how to link 2D (= irrelevant rotation) GUI Text and TransformNode/Mesh?

PG:

1 Like

If you want to demonstrate camera rotation by a TransformNode/Mesh:

PG:

you can get for example a point in front of the camera with a given distance (here 5 unit).

let myVector3FrontCamera = camera.getFrontPosition(5);

Then create your hotsptot on this point.

mesh.position = new BABYLON.Vector3(myVector3FrontCamera.x, myVector3FrontCamera.y, myVector3FrontCamera.z);

2 Likes

The topic of hotspots is extensively discussed in this tutorial series so it’s a good resource too 3D for E-Commerce - Custom Experience | Babylon.js Documentation (babylonjs.com)

thank you,

This solution working perfectly

1 Like