Duplicated clamped polygon on globe

Hello Cesium community.
I have done several tests with clamped polygons in Cesium and I see behavior that I am not sure is desired. Or at least it should have the option to disable it.

I use Viewer with the globe enabled, above 2000 meters high I have a 3D-tile that corresponds to a terrain photogrammetry.
On that 3D-tile I have placed a yellow polygon clamped to ground.

Indeed, the polygon is shown as clamped to the 3d-tile, but it is also shown as duplicate clamped to the globe. See Figure.

Is that a bug or a desired functionality?
In my case it is not desired, I would like to be able to remove the duplicate on the globe.
Any suggestions?




Hello! I believe we chatted on Twitter last night :rocket:

I recommend that you set classificationType: Cesium.ClassificationType.CESIUM_3D_TILE. Check out the following sandcastle that showcases how this can be implemented.

In general, adding the polygon to the 3D Tileset and the globe is useful if you have a 3D Tileset that is embedded in the terrain.

For use cases where the 3D Tileset is stacked vertically above the globe, there is not much that you can do to only add a polygon to the 3D Tileset. Our implementation of clamping uses a shadow volume. Thus, to draw the polygon, the graphics engine more-or-less extrudes the polygon vertically and renders it on any surface that it intersects with.

I suggest that you try using clipping planes to cut out part of the globe and embed your 3D Tileset into it. This will give your users a more seamless and realistic experience. The following sandcastle demo showcases clipping planes.

Cesium Sandcastle

Let me know if you have any other questions or concerns!


Thanks for your answer.
I have studied the use of classification a bit, but I have found that both the use of classification and the clamped implementation do not work properly on mobile phones.
I have raised an issue related to this
issue 9702

To visualize the 3D tools under the terrain I have used depthTestAgainstTerrain but this option does not allow to remove the collision of the camera with the terrain. Ideally, it will collide with the 3D Tile but not with the terrain. Of course I could use clipping planes to cut the globe but I feel that filling the scene with cuts makes it inefficient.

Do you have any advice to disable the camera collisions only with the terrain?

Thanks again



You are welcome! I am happy to help out.

Regarding the issue you mentioned on GitHub, I will check in with the rest of the Cesium development team and try to determine a timeline for when the issue will be addressed.

In terms of disabling the camera collisions with the terrain, have you had the chance to check out the following resources?

I would start with these resources. The first thread includes a link to the “Camera underground controls” pull request which was merged last year. This will help you get up to speed on the capabilities of the new feature.

Let me know if you have any other questions! I am looking forward to learning more about your project.


1 Like