API features to support remote operation?

api

(robertt) #1

I use real time web technologies (WebSockets, etc.) to remote control user experiences, e.g., operate slide decks, launch additional content, reorient the screen.

I'd like to operate the SketchFab viewer remotely (from one controller browser to other receiver browsers). Here's basically how I would do it:

  1. Controller - detect change in 3D model orientation
  2. Controller - get current orientation (getCameraLookAt?) and send to receivers
  3. Receivers - receive current orientation and apply to 3D model (setCameraLookAt?)

Sound doable or API not there yet? #1 seems maybe not doable yet. Need something like onModelPositionChange?


#2

Check out the viewer sharing experiment:

https://labs.sketchfab.com/experiments/viewer-sharing/

Source: https://github.com/sketchfab/experiments/tree/master/viewer-sharing

We don't have an event for the viewer camera change, but we do have events for annotations.

https://sketchfab.com/developers/viewer/functions

As you've figured out, it's probably going to be based on viewer polling with getCameraLookAt and setCameraLookAt