Orbit+perspective Camera (start at a default zoom with ability to zoom in and out with limits)

I’m trying to make my 3d model start at example 200 in terms of zoom and can zoom in to maximum 100 and zoom out to max 300

camera = new THREE.PerspectiveCamera(25, 3/2,0.1, 1000);
controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.minDistance = 120;
controls.maxDistance = 200;

camera.zoom isn’t doing anything and the weird thing is at fov 40 everything was alright when I changed as we want it that way it loads at 120 always and it’s too zoomed as initial

  1. OrbitControls does not use camera.zoom - it does the distance calculations internally.
  2. While there’s no defaultDistance property, you can just replace it with a single controls.update call:
const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.minDistance = controls.maxDistance = 200.0;
controls.update(); // NOTE This will place the camera at the default distance

controls.minDistance = 100.0;
controls.maxDistance = 300.0;