I'm currently in the process of developing a three.js application where I have successfully loaded my STL objects and incorporated 'OrbitControls'. However, I am encountering an issue when attempting to zoom using the middle scroll button on my mouse. It seems to break at a certain point.
Here is my camera and controls code:
camera = new THREE.PerspectiveCamera( 55, window.innerWidth / window.innerHeight, 1, 15 );
//camera.position.set( 3, 0.15, 3 );
// position and point the camera to the center of the scene
camera.position.x = -3;
camera.position.y = 4;
camera.position.z = 5;
camera.lookAt(new THREE.Vector3(0, 0, 0));
controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.damping = 0.2;
//controls.minZoom = 0;
// controls.maxZoom = 1;
//controls .noZoom = true;
controls.addEventListener( 'change', render );
I have attempted using minZoom
and maxZoom
within the controls but it has not resolved the issue.
If anyone has suggestions on how to effectively limit the zoom so that my object does not break beyond a certain point, I would greatly appreciate your input.