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: http://on3dprinting.com/wp-content/uploads/2013/10/Staples-Mcor-3D-Printer-Map.jpg : 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 https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=Terrain%20Clipping%20Planes.html&label=Showcases

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

Thanks

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.

Thanks,

Gabby

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: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=cace518340347a15839f5fad2eb5e354

Thanks,
Gabby