Skip to content
Three.JS control to rotate Object3Ds as if touching a trackball.
Branch: master
Clone or download
Latest commit 5b0755a Jun 24, 2019

Readme.md

SpinControls for Three.JS

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

Example

https://paulkelliott.github.io/spin-controls/

Use

var radius = 50;
var mesh = new THREE.Mesh(
  new THREE.SphereBufferGeometry( radius, 16, 8 ),
  new THREE.MeshBasicMaterial( { color: 0x00ff00, wireframe: true } )
);
scene.add( mesh );

var spinControl = new SpinControls( mesh, radius, camera, renderer.domElement );  
You can’t perform that action at this time.