About a year ago I made a solution for panning and zooming in a 3D world (Three.js) using a formula provided by @DMGregory. Here is the post: How to panning camera on XZ axis with different angles
The result is very cool, because it really feels like you are dragging the scene: https://codepen.io/josema/full/zMeNry
The problem
It turns out that I have to implement a following-object feature. In other words, I have to change the position of the camera to any part of the scene without losing the pan/zoom feature. And I think is not possible with this solution, because in this case the camera.lookAt.y
changes when you pan. And it should be 0 to achieve what I want.
This is an example of what I would need, but the "responsive feeling" is not the same. https://threejs.org/examples/misc_controls_orbit.html (right click for panning). In this solution, we can easily say that the camera.lookAt.y
is always 0.
The perfect solution is implemented by Google Earth:
https://earth.google.com/web/@40.40420135,-3.6986483,622.13605706a,960.94224964d,35y,-4.92354397h,63.56373285t,0r
Because it has the responsive feeling and the camera.lookAt.y
is 0 when panning.
Question
Is it possible to implement something similar to Google Earth easily? If not how would you implement the https://threejs.org/examples/misc_controls_orbit.html?