I don’t understand the minDistance for the Orbit Controls is scaling the model down and zoom does not work anymore, if I set the value to anything higher than 1 it does not work correctly, the maxDistance is working as it should.
Just tried it. Perspective camera + orbit controls + minimal distance 5 + maximal distance 15 … and it works as expected. Three.js r155.
Maybe something in your code is making a problem or maybe your expectation is different. BTW, orbit controls with perspective camera does not zoom – zooming is only for orthographic camera. What you see as zooming is a side effect of getting closer to the target.
Thanks for adding the sliders. I checked the min/max distances of the camera and they work exactly as expected. Most likely you have different expectation, that’s why the outcome is surprising to you. What behavior do you expect?
In addition to the description of min/max distances in my previous reply, here is a picture. I hope it will make the situation more clear:
I am having trouble understanding the maxPolarAngle and minPolarAngle, I have added thejm in the live settings in the Orbital controls folder named Vertical rotation min angle and Vertical rotation max angle…
The minPolarAngle dose not seam to do anything, I really don’t understand this one.
The polar angle is the vertical angle of the camera. If you imagine the camera sitting on an imaginary sphere around the target object, the polar angle defines how the camera slides up or down (towards the poles).
The angles are measured from the “North Pole” via the “Equator” down to the “South Pole”.
If you work with radians (this is the almost default unit for angles in Three.js):
the polar angle is between 0 and π
the North Pole is 0 radians
the Equator is π/2 radians
the South Pole is π radians
If you work with degrees (they must be converted to radians)
the polar angle is between 0 and 180°
the North Pole is 0°
the Equator is 90°
the South Pole is 180°
The illustration below is for using degrees:
For your online demo, set the range of minPolarAngle and maxPolarAngle to be both [0°,180°].
Edit: Here is another illustration that makes better representation of “North Pole” and “South Pole”, when you work with degrees:
I have another question it seems that you have experience with threejs so I apologize if this is too much, if you can’t answer I will create a different topic.
My question is how can I attach a ‘marker’ to a specific point on a model and most importantly how to update the ‘marker’ position if the model has an animation, for example, the model is a car and the ‘marker’ is attached to the car door, when the door opened via the model animation can the ‘marker’ update it’s position so that it stays in the same point keeping track of the animation visually.