How can I track the camera position

Hello how are you? I would like to know how I can track the position of the camera without clicking on an object.
I would also like to be able to control the play action through code. That is, for example, when the camera passes near the object that contains the video texture, it will be played.
Thank you very much!

You can track the camera from your JavaScript code using getCameraPosition() function documented here: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

To start a video, you need to first find a material that has a video texture using findMaterial() function (also documented in the same document). Then, you can set isPlaying property of the material to true or false.

1 Like