I am trying to add the same longitide and latitude but different height point pair to the Cesium map:
var point1 = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-100, 40, 0),
point : {
color : new Cesium.Color(1.0, 0.0, 0.0, 1.0),
pixelSize : 10
}
});
var point2 = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-100, 40, 1000),
point : {
color : new Cesium.Color(0.0, 1.0, 0.0, 1.0),
pixelSize : 10
}
});
When The red and green points have been shown on the map, they are not coincide with each other:
The pitch angle is set -90 degrees already. Does any cemera settings or parallel projection function can make these two points coincide when I look down the earth? Thanks for your help~
From you description, (I'm not a Cesium dev) it's impossible to have coincidence for each couples of points in 3D view because the Earth is spheric! In 3D mode you can reach coincidence if your camera is just above your points.
Cesium currently as 3 display modes
1st-Perspective view of an ellipsoid
2nd-Perspective view of a rectangle
3rd-Orthographic view of a rectangle (also no terrain, pitch always -90)
The only mode that will overlap points that share the same lat/lon but different heights for an entire flat screen (not just the center) is the 3rd mode with pitch -90. Of course showing the Earth’s surface on a rectangle surface is warped.
There’s a way you can get ‘almost’ orthographic projection of an ellipsoid. Go ape with the far clipping plane and camera height, then go infinitesimal with the camera.frustum.fov , then you’d have something ‘almost’ indistinguishable from true orthographic. Something like this
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var camera = viewer.scene.camera;
var CC3 = Cesium.Cartesian3;
var camdir = new CC3();
camera.frustum.far = 1e12;
camera.frustum.fov = 1e-5;
var height = 1e10;
var cartographic = new Cesium.Cartographic(-117/180Math.PI,32/180Math.PI,height);
camera.position = viewer.scene.globe.ellipsoid.cartographicToCartesian(cartographic);
CC3.negate(camera.position, camdir);
CC3.normalize(camdir,camera.direction);
CC3.cross({x:0,y:0,z:1},camera.direction,camera.right);
CC3.cross(camera.right,camera.direction,camera.up);
``
However movement is a bit choppy probably due to only have a 64bit precision computer and browser. Maybe try something with a tad lower height for smoother movement. It’s pretty cool that you can zoom in onto one house from 10 giga-meters distance with Cesium! Actually if you zoom onto one house the movement becomes smooth, I wonder why?