Inaccurate position and displacement issues when using Cesium.Primitive

Version: 1.119
When I use Cesium.Primitive to create a rectangular geometry and turn on Cesium.Terrain.fromWorldTerrain, the position of the rectangular geometry will be inaccurate and when I press the left button to pan the camera, I can see that the geometry has moved (translated).
When I do not turn on Cesium.Terrain.fromWorldTerrain, this problem does not occur, or when I replace Cesium.Primitive with Cesium.GroundPrimitive, this problem will not occur. Is this phenomenon correct? If this phenomenon is correct, how can I draw a Cesium.Primitive with accurate position and no displacement when Cesium.Terrain.fromWorldTerrain is turned on? My needs prevent me from using Cesium.GroundPrimitive.
The demo is attached below. You can reproduce the above phenomenon by placing it in the Apps directory.
HelloWorldTest.zip (1.5 KB)


Reproduction steps

  1. Use Cesium.Primitive to create a rectangular geometry, and enable Cesium.Terrain.fromWorldTerrain
  2. Press and hold the left button to pan the camera
  3. Use Cesium.Primitive to create a rectangular geometry, and do not enable Cesium.Terrain.fromWorldTerrain
  4. Press and hold the left button to pan the camera
  5. Use Cesium.GroundPrimitive to create a rectangular geometry, and enable Cesium.Terrain.fromWorldTerrain
  6. Press and hold the left button to pan the camera
  7. Compare the three situations

Browser:
CesiumJS Version:1.119
Operating System:windows 10

Hi @NilZ, welcome to the community!

Here is a Sandcastle with your code. From what I can see, if I change GroundPrimitive to Primitive, there is only a displacement in height. The x and y position are unchanged.

This behavior is expected: GroundPrimitive will place the rectangle at the height of the terrain. If no terrain is defined, the rectangle will be on the WGS84 ellipsoid.

Primitive does not know about the terrain, so the rectangle is positioned on the WGS84 ellipsoid by default.

If you want to control the height, you could construct the rectangle using Rectangle.fromCartographicArray instead of Rectangle.fromDegrees.