2D offsets between Cesium and other 3D engines


We’ve ran into an interesting issue using Cesium.

The basic issue arises from a comparison between 2 3D engines which show the same scene, with a slight difference between the 2D positions of the same world-positioned objects.

We’ve used cesium and OpenCV (projectPoints with a simple intrinsics matrix - shown below) to render the same KML in 3 camera positions (500m altitude, 5000m altitude and 20000m altitude). The yellow "X"s are from Cesium, the white dots are from OpenCV.

This the camera position being used:

  "Yaw": 0,
  "Pitch": -90,
  "Roll": 0,
  "Altitude": 500,
  "Latitude": 0,
  "Longitude": 0,
  "fov": 60,
  "AspectRatio": 1.777777778 (16/9)

We were expecting to see the white dots in the dead center of each yellow X, but we’re seeing a slight difference.

These offsets appear in other scenes where it’s hard to pinpoint exactly the differences between the renderers, but we believe this pose shows the problem in more clarity. We can generate other samples as needed.

Can you shed some light to where this problem originates from?
Is there a parameter we can tweak in cesium to have better fit to the OpenGL 3D projections?
Alternatively, is there a change to the camera pose we need to do to achieve a perfect fit?

Nitay from Edgybees

PS: This is the intrinsics matrix from OpenCV:

[[1.66276878e+03 0.00000000e+00 9.60000000e+02]
 [0.00000000e+00 1.78014143e+03 5.40000000e+02]
 [0.00000000e+00 0.00000000e+00 1.00000000e+00]]

Can you share a Cesium example in Sandcastle and share the essential OpenCV code?

Hi Scott,

We prefer not to share part of the code. Might we share with you directly?


Yes Nitay, you may message me directly.