THREE.js Limit Zooming in mousewheel event

1.6k Views Asked by At

Can anyone please tell me how to limit zooming in and out of an model in three.js. I came across trackball controls but there is no function or property to limit zooming.Tried using orbit controls also but when using along with trackball controls i could find some issues in rotation and panning.

Thanks in advance.

1

There are 1 best solutions below

0
Aasha joney On BEST ANSWER

I was working with THREE.js version70 which doesn't support to limit zooming. In current THREE.js version 83 of Trackball controls we could limit the zooming in and out using the following code,

controls.minDistance = 10;
controls.maxDistance = 100;