How can I change zoom out limit? I can only see min zoom and max zoom parameters.
To change the zoom out limit in your OrbitControls, you need to modify the minDistance
and maxDistance
properties of the controls. These correspond to the minimum and maximum distances the camera can be from its target.
Here’s a quick guide on how to adjust these limits:
-
minDistance: This is the minimum distance the camera can be from the target. You can set it in the OrbitControls configuration to ensure the camera doesn’t get too close.
-
maxDistance: This is the maximum distance (zoom out limit) the camera can be from the target. Adjusting this will control how far the camera can zoom out.
You should find these properties in your OrbitControls setup. Here’s a code snippet to illustrate:
controls.minDistance = 0; // Set your desired minimum distance
controls.maxDistance = 100; // Set this to desired zoom-out limit
These parameters control the maximum zoom-out range of your camera. If you adjust the maxDistance
, you will effectively change the “zoom out limit” (see the documentation).
If you need more specific guidance or if you’re looking for different parameters in the code, please provide a bit more detail about your project setup or the context in which you’re using these controls.
24 replies left
thread_ooTNj9B8wShiFEvPncfvVogT
Reply to this message to continue the conversation
I can’t find minDistance and maxDistance variables in the script.
Hi Saad Baig! If you’re unable to locate the minDistance
and maxDistance
variables in your script, it’s possible that you’re using a different camera control or that they’re set as properties of a specific control instance.
Here’s what you can do:
-
Check OrbitControls Initialization: Look for where your OrbitControls are initialized. It should look something like this:
const controls = new OrbitControls(camera, renderer.domElement);
-
Add minDistance and maxDistance:
If they’re missing, you can add them right after initializing the controls:controls.minDistance = 1; // Minimum zoom controls.maxDistance = 100; // Maximum zoom-out limit
-
Review the Documentation: If you are using a custom controls implementation or a different library, check the corresponding documentation to find similar properties. The concept of distance limits is usually present in camera control implementations.
If you need to see samples or documentation for a specific implementation, you can refer to the Needle Engine samples repository or the Needle Engine API docs.
Let me know if you need further assistance or clarification!
23 replies left
thread_ooTNj9B8wShiFEvPncfvVogT
Reply to this message to continue the conversation
Hello, what do you mean by zoom out limit? Is it something else than “max zoom” ? (maxZoom is internally set to maxDistance
by the OrbitControls script)
im assuming max zoom is the limit you can zoom IN. I want to view from afar so i want to increase the zoom Out limit. current it stops at a certain distance when I zoom out.
Max zoom is max distance, meaning how far you can zoom out
Min zoom is the min distance, you can not zoom closer than that value.
Ahaan I see. Thanks a lot
This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.