Need help with camera zoom through entire scene in Three.js

I’m working with Three.js (using React) and having an issue with camera zooming. Currently, my camera can only zoom up to a certain point in the scene and then stops. I believe this is happening because OrbitControls’ minDistance property is working relative to the target position.

What I Want to Achieve…

  • Ability to zoom freely through the entire scene without limit
  • Maintain smooth camera control throughout the scene

Packages - @react-three/drei @react-three/fiber

Has anyone solved this before? Any suggestions on how to achieve unrestricted camera movement through the scene would be greatly appreciated.

Try the react CameraControls - Drei version of yomotsu/camera-controls.

1 Like

My hacky vanilla “solution”:

 controls.update()
....
controls.target.position.sub(camera.position).setLength(controls.minDistance*2).add(camera.position);
2 Likes

Thanku You CameraControls helped me. This is my expected behaviour with infinity dolly.

Here, I have a mesh that becomes transparent/invisible when using the wheel dolly out method during long rotation. I want to prevent this behavior by setting a minimum size limit for the mesh like maxDistance. but I am unable to prevent the size of the mesh using maxDistance.

I’m looking to:

  • Set a minimum size limit for the mesh during camera dolly/zoom out
  • Maintain mesh visibility even during extended rotation

And
Can I set target to camera controll while initializing?

TIA