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.
Asked 2 months ago by InterstellarPioneer601
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
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?
Comments 0
•Answers 0
•Views 71
No comments yet.