Display the different height point pairs in the same place

Hi all,

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~


Hello, it's normal if your viewer is in 3D or Colombus mode. In 2D mode, the two points are on the same vertical.

bobac…@gmail.com於 2015年3月23日星期一 UTC+8下午5時07分03秒寫道:

Hello, it’s normal if your viewer is in 3D or Colombus mode. In 2D mode, the two points are on the same vertical.

Thanks for your information. But there is a projection function called Parallel Projection (http://www.cs.princeton.edu/courses/archive/fall99/cs426/lectures/view/img019.gif).

This projection can coincide with different height points in 3D view. Does Cesium provide this kind of projeciton? Thanks a lot~

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 uses Perspective and Orthographic

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.

Thanks for your information. It’s very helpful for me~

Hyper Sonic於 2015年3月24日星期二 UTC+8上午2時16分25秒寫道:

I’m glad it helped.

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);


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?