I'm using the combinedcamera.js along with the orbitcontrols.js https://github.com/mrdoob/three.js/blob/master/examples/js/cameras/CombinedCamera.js https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js
I have it working so that the cameras can be switched, and both can be zoomed in and out. However, orbitcontrols re-positions the perspective camera to simulate the zoom and it doesn't do this with the orthographic camera(it changes the fov,etc)..
This ends up causing the camera far frustum plane to move in perspective mode(I want this), and it doesn't move in Orthographic mode(I want it to move).
I have fixed this, by making both the perspective and orthographic camera get repositioned. The orthographic camera doesn't use its position to determine the zoom so there is a problem.
The problem is that when I switch between cameras, they don't appear to have the same zoom amount.
I guess the question is, how do I make the orthographic camera rely on camera position to determine the zoom amount so that it always looks to have similar zoom as perspective camera?
Okay, so after experimenting a lot, I found a hackish way to get a result that is close enough. I found accidentally that if the far frustum value was set to 25, it would work perfectly.. so I made an equation to compensate if the value is different. It's close enough, but perhaps someone could see where it could be improved?
I replaced in combinedcamera.js
with
And I added this line in combinedcamera.js
right before this
here's the full section
also I change the this.zoom to just 1 for perspective camera
Also, I had to adjust the orbitcontrols