Google Maps Example wrong height with orthographic camera
Description
Hello, in the google maps example if you switch to the orthographic camera the height in the hash gets extreme. For example if you go here and enable the orthographic camera, the height will jump from about 3461 to 1630483.
Reproduction steps
- Go to google 3d tiles example
- Toggle orthographic camera
- Observe height
Code
I guess you cannot just take camara.position directly when the camera is orthographic here:
const localCameraPos = camera.position.clone().applyMatrix4( tilesMatInv );
I would be very interested in the correct solution, in my app i work around the same problem by calling TransitionManager.syncCameras() and then reading TransitionManager.perspectiveCamera.position but i dont know whether thats the right approach.
Live example
https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/googleMapsExample.html#lat=40.7787&lon=-73.9645&height=3461.14&az=-17.85&el=-83.87&roll=18.26
Screenshots & Tile Set
No response
Library Version
v0.4.10
Three.js Version
r170
Yes the lat / lon in the demo is designed to be applied to the perspective camera and was never updated to apply to the orthographic camera. The orthographic camera fundamentally works differently from the perspective camera in order to avoid rendering artifacts like near plane clipping - specifically it is pulled back significantly leading to a high height and an apparently inaccurate calculated latitude and longitude.
Calculating the perspective camera transformation to update the hash and seems like a fine solution to me. Would you like to make a PR with the change for the demo?
Fixed in #1170