My guess is that this is the nature of the 2D mode. While 2D mode displays world imagery on a flat surface, the 3D mode displays the same imagery on a curved surface, i.e. the globe. As a result, there will be differences between their appearances.
i think a little bit distortion is ok, but from my point of view it seems, that I have only distortion in x and that it is a lot !
Other question - I thought changing from 3d in 2d changes to orthographic frustum - but i see in debug, that I have a orthographicofffrustum - what is the difference. I have the impression, that the aspect ratio changes a lot.
Are you talking about OrthographicOffCenterFrustum? Both the OrthographicOffCenterFrustum and OrthographicFrustum classes achieve the same thing. OrthographicOffCenterFrustum is lower level and defines the frustum by its six planes, whereas OrthographicFrustum takes a width / aspect-ratio and converts that to the six planes. The OrthographicFrustum uses an OrthographicOffCenterFrustum internally.
A member of the Cesium team suggested switching to Web Mercator projection in 2D. There is some inherent skew when Bing Maps’ imagery, which is natively Web Mercator, is projected into Geographic (the default). Here is a sandcastle that demonstrates the difference.
I’m not sure what do you mean by the zoom in 2D vs. 3D being different. But in the Sandcastle, the zoom of the 2D map is controlled by this block of code:
// Given the pixel in the center, get the world position
var newWorldPosition = view3D.scene.camera.pickEllipsoid(viewCenter);
if (Cesium.defined(newWorldPosition)) {
worldPosition = newWorldPosition;
}
distance = Cesium.Cartesian3.distance(
worldPosition,
view3D.scene.camera.positionWC
);
// Tell the 2D camera to look at the point of focus. The distance controls how zoomed in the 2D view is
// (try replacing `distance` in the line below with `1e7`. The view will still sync, but will have a constant zoom)
view2D.scene.camera.lookAt(
worldPosition,
new Cesium.Cartesian3(0.0, 0.0, distance)
);
Cartesian3.distance calculates the same whether the map is in 2D or 3D mode, so the height of the camera above both modes is the same. It may look different simply because in 3D we zoom in on an actual globe, and in 2D we’re zooming in on a plane.
I think you forgot to add mapProjection : new Cesium.WebMercatorProjection() to options2D, which I suggested in an earlier reply. This will eliminate more of the distortion that you get from the default projection.
I mentioned distortion because in your first image (without Mercator projection), the zoom is basically the same, but the lakes are distorted horizontally. This was the issue that you brought up when you first created this post. In order to account for that distortion, you would have to switch projections.
This does mean that the distance from the map results in different zoom for both views. You could artificially scale the distance that the 2D map zooms so that it’s more aligned with the image of the 3D globe. For example, I modified the lookAt function to result in this line of code:
view2D.scene.camera.lookAt(
worldPosition,
new Cesium.Cartesian3(0.0, 0.0, 1.5 * distance)
);
Unfortunately I have no answer off of the top of my head. If I find a solution I’ll respond with an update. In the mean time, if any community members or Cesium developers have suggestions, they’re welcome to share!
I’m having the same issue working on an airplane tracking tool. I use terrain 3D options in a 2D map:
mapProjection: new Cesium.WebMercatorProjection(),
sceneMode: Cesium.SceneMode.SCENE2D,
Did you find any solution? since the aircraft move all around the world I had to create an array of factor based on latitude… but I don’t really like how it works.
I can remember the Problem. I think the Solution was to determine the factor (1.5), which depends on the different scale (compare flightheight or pixelsize in 2d and 3d)