three-story-controls

Home > three-story-controls > ThreeDOFControls

ThreeDOFControls class

Control scheme for slight rotation and translation movement in response to mouse movements (designed to be used in conjunction with other control schemes)

Signature:

export declare class ThreeDOFControls implements BaseControls 

Implements: BaseControls

Remarks

Note: CSS property touch-action: none will probably be needed on listener element

See ThreeDOFControlsProps for all properties that can be passed to the constructor.

DEMO w/ story points

DEMO w/ scroll controls

Example

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 ThreeDOFControls(cameraRig)

controls.enable()

// render loop
function animate(t) {
 controls.update(t)
}

Constructors

Constructor Modifiers Description
(constructor)(cameraRig, props)   Constructs a new instance of the ThreeDOFControls class

Properties

Property Modifiers Type Description
cameraRig   CameraRig  

Methods

Method Modifiers Description
disable()    
enable()    
isEnabled()    
update(time)