Clipping Planes excluding terrain rendering outside a specific area

Hi we are experimenting with clipping planes with cesium 1.4 , but I can’t understand how to achieve the following:

I want to achieve something like the one in this image: : having a fixed “cube” where I can see the terrain in 2.5D projection that is inside that cube but excluding the rendering outside of that.

Bonus point is: I want to have this “cube” fixed on the screen and the globe can pan zoom.

Is exactly the opposite of the sandcastle example of terrain clipping planes

Gabby or any one from cesium team can help me to find how it’s possible?


Hi Marco,

The cube is possible in 3D, all you need to do is set specify ClippingPlanesCollection.unionClippingRegions to be true and reverse the distance on the clipping planes, like in this example. Clipping planes are not yet implemented in 2.5D mode however.



That’s great, thanks Gabby.

But what about the possibility to keep the clipping cube fixed on the center of the screen and move the globe behind it?

I like the idea of having a “focused” clipped area, but I also want to pan and zoom around changing the map “inside” the clipped area. Is it achievable?

Thank again

You’ll definitely need to adjust the camera controls for your needs, but you should be able to update the ClippingPlaneCollection.modelMatrix based on the location chosen from picking the point on the ellipsoid at the center of the screen. I modified by example: