Skip to content

repalash/OffsetOrbitControls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OffsetOrbitControls

Small extension to OrbitControls to allow for offsetting the target position on screen. This is useful for zooming and rotating around an arbitrary point on the screen to create model viewers with offset on screen. It also allows for panning around without changing the target position.

Live Demo: https://repalash.com/OffsetOrbitControls/

To use replace OrbitControls with OffsetOrbitControls and call controls.update() in the render loop. see index.html

To reset the target or to set the offset on the screen, set controls.targetOffset.set(x, y, 0) in screen space NDC.

To fix the target offset on screen, disable panning by doing controls.enablePan = false

About

Modified three.js OrbitControls with target offset.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published