I hope the visual effect is similar when I switch the mode. Position and rotation work fine, but how to copy âzoomâ? Directly copy zoom from perspectiveCamera seems useless. I think perspective cameraâs âzoomâ is determined by distance.
My related question: How to make a CombinedCamera? - #3 by ToniFF (I have to manage two cameras myself without an available CombinedCamera. I tried to update cameras like what CombinedCamera do in toOrthographic and toPerpspective, but I failed.)
âzoomingâ can have different meaning depending on the context⌠In a orthographic camera context, it means reducing the frustum, and in perspective it could mean moving the camera forth OR decreasing the FOV.
So what you really want to do I guess is to tweak these parameters depending on the camera your are using, in order to make an object take the same space on screen.
This is useful for me to set my cameraâs position at begin! But the function canât be used on orthographic cameras because it requireâs cameraâs fov. My problem is that after I make any random controls by OrbitControls with perspective camera, how to copy the state with orthographic camera? (And copy orthographic to perspective when I switch the mode again).
But you can use the same concept with orthographic camera I think.
Namely, an âillusion of same zoomâ function that takes as argument the object to focus on ( you need a reference ), in which you get the distance between the centre of this object and each plane of the camera frustum ( but near and far planes ). Once you have these distances, you switch to orthographic camera with the same position and rotation than the perspective camera, as you already did apparently, and then you set the ortho cameraâs frustum planes to the distances you got earlier.
Would it seem like a good option ?
There is no one-size-fit-all option, because you must adapth the frustum according to a reference object, as illustrated on this drawing :