Camera positioning is off after changing from 2D to 3D
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
When switching from 2D to 3D, the camera will appear to be zoomed in close to the terrain; however, if you check `viewer.scene.camera.positionCartographic.height`, it will still have the same value as it did before the morph. When zooming out, the skybox is blurry and the globe loses its texture. Seems like some kind of scaling is off.
Here's a sandbox to demonstrate - notice the camera height being printed in the console at an interval of 2 seconds. Things get weird when you switch to 3D:
http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=ceee26395fb91033a25e79df84ddb785
Didn't look too much into it, but I'm guessing the change that introduced the bug was somewhere in this PR: https://github.com/AnalyticalGraphicsInc/cesium/pull/5021
Contributor guide
Research direction
Reproduce the behavior in the linked Hello World Sandcastle example, watching camera.positionCartographic.height while switching from 2D to 3D. Review the change introduced by PR #5021 and trace the camera morphing path. Done means the camera position and apparent zoom remain consistent after the switch, without blurry skybox or globe texture when zooming out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100