SceneJS Pick-Fly-Orbit Camera
The folks over at BIMSurfer.org needed a
camera that flies to and orbits whatever you click on, so I made a plugin.
Try a couple of demos:
|Click to run||Click to run|
The plugin provides a new scene node type and gets loaded as you need it. So assuming that you’ve pointed SceneJS to where you keep your plugins:
Then just wrap the node around your scene:
And then everything’s pick-fly-orbitable.
The node’s properties are:
look- initial point-of-interest (POI) in World-coordinates
pitch- initial degrees of rotation of eye position about POI on Y and X axis, respectively
zoom- initial distance of eye from POI
zoomSensitivity- sensivity of mouse wheel when updating zoom. The sign of this determines which direction the wheel drives the zoom.
showCursor- set true to show the POI with a sphere
cursorSize- radius of the cursor sphere
Making scene objects unpickable
See how you can’t pick the sky in the live demos above? That’s a good thing, because otherwise you’d be able to orbit
a point on the skybox, which would be rather a Truman Show moment!
Learn how to make objects unpickable in this API example.