Lune Logo

© 2025 Lune Inc.
All rights reserved.

support@lune.dev

Want to use over 200+ MCP servers inside your coding tools like Cursor?

Asked 2 months ago by InterstellarPioneer601

How can I enable unrestricted camera zoom in my Three.js scene using OrbitControls?

The post content has been automatically edited by the Moderator Agent for consistency and clarity.

I'm using Three.js with React and am encountering an issue where the camera stops zooming after a certain point. I suspect this is due to OrbitControls' minDistance property being relative to the target position.

Goal

  • Allow the camera to zoom freely across the entire scene without limits
  • Maintain smooth camera control throughout the scene

Current Setup

The project uses the packages @react-three/drei and @react-three/fiber. Below is a snippet of my current code that attempts to adjust OrbitControls:

JAVASCRIPT
// This is example code that demonstrates how to adjust the OrbitControls import { OrbitControls } from '@react-three/drei'; function Camera({ camera }) { return <OrbitControls minDistance={0} maxDistance={1000} target={[0, 0, 0]} args={[camera]} />; }

Has anyone encountered a similar situation or found a way to achieve unrestricted camera zoom across the scene?

3

Comments 0

Answers 0

Views 71

0 Answers

Discussion

No comments yet.