Working with Scene Cameras

By adding Scene Cameras into your scene in the editor, you can add interactions to snap/pan to the viewpoints without the user having to use the camera themselves. You can target the cameras using either their title or their uuid as shown below.

Snapping to a camera

You can snap to the selected camera using the following code:

comms.send('snapToCamera', {id: <uuid>});
comms.send('snapToCamera', {title: <title>});

Panning to a camera

You can smoothly pan to the selected camera using the following code:

comms.send('panToCamera', {id: <uuid>});
comms.send('panToCamera', {title: <title>});

Full structure of the panning options:

{
  id: <uuid>, // id of the viewpoint
  title: <string>, // title of the viewpoint
  rotation: <boolean>, // If it will also match the viewpoint's rotation
  time: <int(ms)>, // Time in milliseconds to transition to the viewpoint
  pivot: <string - 'auto|self'> // Sets the pivot point of the viewpoint to rotate on the spot or calculate position in front of viewpoint
}