I'm running Three.js r69 with the bundled OrbitControls.js. I have a simple scene with a couple of objects that are selectable. I'd like to be able to disable zooming while an object is selected and re-enable it once I've cleared the selection.
I'm working on a temporary solution, but it involves editing the OrbitControls.js code. This could make it really annoying to upgrade to a new version of Three.js, especially if OrbitControls is ever changed.
Is there currently a way to enable/disable certain features (like zooming, panning, or orbiting) on the fly, independently of each other?
Is simple:
controls = new THREE.OrbitControls( camera );
// to disable zoom
controls.enableZoom = false;
// to disable rotation
controls.enableRotate = false;
// to disable pan
controls.enablePan = false;
If you're editing the source you must have seen noZoom and noPan.
And this post shows how to constrain rotation.
Do these not meet your need?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With