Home > three-story-controls > StoryPointsControls
Control scheme to transition the camera between given points in world space.
Signature:
export declare class StoryPointsControls extends EventDispatcher implements BaseControls
Extends: EventDispatcher
Implements: BaseControls
See StoryPointsControlsProps for all properties that can be passed to the constructor.
See StoryPointMarker for POI properties.
const pois = [
{ position: new Vector3(...), quaternion: new Quaternion(...) },
{ position: new Vector3(...), quaternion: new Quaternion(...) },
]
const scene = new Scene()
const camera = new PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
const cameraRig = new CameraRig(camera, scene)
const controls = new StoryPointsControls(cameraRig, pois)
controls.enable()
controls.goToPOI(0)
// Assuming DOM elements with classes 'nextBtn' and 'prevBtn' have been created
document.querySelector('.nextBtn').on('click', () => controls.nextPOI() )
document.querySelector('.prevBtn').on('click', () => controls.prevPOI() )
Constructor | Modifiers | Description |
---|---|---|
(constructor)(cameraRig, pois, props) | Constructs a new instance of the StoryPointsControls class |
Property | Modifiers | Type | Description |
---|---|---|---|
cameraRig | CameraRig |
Method | Modifiers | Description |
---|---|---|
disable() | ||
enable() | ||
getCurrentIndex() | ||
goToPOI(index) | ||
isEnabled() | ||
nextPOI() | ||
prevPOI() | ||
update() |