How can I configure the OrbitControls
to gradually bring a scene to a standstill while panning, like on this website, instead of stopping instantly?
Below is my code snippet:
controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.mouseButtons = {
ORBIT: THREE.MOUSE.RIGHT,
ZOOM: THREE.MOUSE.MIDDLE,
PAN: THREE.MOUSE.LEFT
};
controls.enableDamping = true;
controls.dampingFactor = 0.25;
controls.screenSpacePanning = false;
const direction = new THREE.Vector3();
camera.getWorldDirection(direction);
camera.getWorldPosition(controls.target);
controls.target.addScaledVector(direction, 50);
Thank you!