Paul's VizWorkshop

Crafting 3D realities since 2005

SpinControls Module for Three.js

August 14, 2020

Rotate 3D objects or the camera as if touching a trackball.

Demo and Source

A three.js control to rotate Object3Ds as if touching a trackball. The point clicked on by the mouse stays under the moving mouse. Touch and momentum support.

Wrote it to help me understand 3D rotations.

After implementing SpinControls.js, I ran across this excellent discussion of 3D rotation approaches here: https://www.mattkeeter.com/projects/rotation/