yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.
https://yomotsu.github.io/camera-controls/
MIT License
1.89k stars 241 forks source link

It would be nice to have setFov method with smooth transition #504

Open vinkovsky opened 2 months ago

vinkovsky commented 2 months ago

Is your feature request related to a problem? Please describe.

-

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

richfwebb commented 4 weeks ago

Is this different than setZoom?

yomotsu commented 3 weeks ago

Exactly. The functionality of zoom and FOV are closely related. zoom affect its fov in a perspective camera. see https://github.com/mrdoob/three.js/blob/7a62164566e030611c0e4c92e9747bc005cdab26/src/cameras/PerspectiveCamera.js#L217

Use zoom instead, which works in both perspective and orthographic.

If you wish to compute the final FOV, please check below. https://github.com/mrdoob/three.js/blob/7a62164566e030611c0e4c92e9747bc005cdab26/src/cameras/PerspectiveCamera.js#L88-L93