Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: View synchronization #9

Closed
klokan opened this issue Jul 17, 2014 · 2 comments
Closed

Core: View synchronization #9

klokan opened this issue Jul 17, 2014 · 2 comments
Milestone

Comments

@klokan
Copy link
Member

klokan commented Jul 17, 2014

Correct implementation of synchronization of ol.View and Cesium.Camera:

  • map center is the target of view
  • resolution is calculated from the distance between the target and camera (resolution of the tile displayed in the center of screen)

Problems:

  • camera has to be always directed towards the planet - what center should be set if this does not happen?
  • Warning: on all the interactions once the terrain is turned on we depend on implementation and merge of this pull request: Camera-Terrain interaction CesiumGS/cesium#1817
    It is expected that camera never flies under the terrain.

Performance issues:
It is expensive to calculate the target and resolution too often (picking). We may need throttling and additional optimisations.

Note: When camera is tilted and resolution is calculated on target, the resolution can “jump” in ol.View - looking at a mountain, shift aside, looking far in a valley.

Note: With terrain turned on, the “resolution” of the view may differ substantially from altitude (different tiles with zoom level 16 on Everest and in Sahara at the same altitude).

When working on #2 (animated switch between 2D and 3D) the elevation value may be required to the fly from/to a perpendicular view on the target (original map center).

Warning: If somebody changes center in ol.View we will set perpendicular (reset) view at that position in Cesium in this first implementation. To preserve tilt, roll, etc. the ol3cesium method .setTarget() should be used instead.

@klokan
Copy link
Member Author

klokan commented Aug 8, 2014

Implemented, merged via #16 after discussion and review.

There is no need for reset of camera anymore in the existing implementation after ol.View changes Camera target - method is now called 'setCenter' (comment on the last Warning above)

Performance of synchronization may be improved with No rendering if invisible & lazy sync #19

@klokan klokan closed this as completed Aug 8, 2014
@klokan
Copy link
Member Author

klokan commented Aug 8, 2014

A note: in Google Maps WebGL Globe the look towards the sky is not allowed - Google's answer to mentioned problem above. Try Shift drag in:
https://www.google.com/maps/@44.1798527,7.3205526,87149a,20y,8.57h,68.69t/data=!3m1!1e3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant