Marcel Ennix Marcel Ennix - 1 year ago 234
Javascript Question

OrbitControls with damping

Is there a way, plugin or idea to give the THREE.js

the effect of inertia when spinning?

I would like to spin a world-sphere with some damping like this:

The original
behaviour looks like this:

Answer Source

OribtControls now supports damping / inertia.

controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.enableDamping = true;
controls.dampingFactor = 0.25;

Then in your animation loop add

controls.update(); // required if controls.enableDamping = true, or if controls.autoRotate = true

three.js r.72

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download