openlayers / ol-cesium

OpenLayers - Cesium integration
http://openlayers.org/ol-cesium/
BSD 2-Clause "Simplified" License
997 stars 325 forks source link

Rotation precision when switching from 2D -> 3D and back to 2D #306

Open bartvde opened 8 years ago

bartvde commented 8 years ago

So my map has a view with rotation 0. I then switch to 3D view which uses ol3-cesium. When switching back the 2D the rotation is not exactly 0 anymore but 3.043247875922678e-10 is there an explanation for this loss of precision in the rotation of the view?

gberaudo commented 8 years ago

The 2D and 3D views are synchronized using a floating point computation. There is a loss of precision in the rotation and the other view parameters.

What could be done, is to apply the OL3 view constraints when back to 2D:

bartvde commented 8 years ago

ah thanks for pointing to this code snippet @gberaudo