I want to create Clipping 3D Tiles and Globe at the same time so I can see the structure of the aboveground and underground buildings, is there any way to do it? in this example only clipping for 3D Tiles
Hi @Yen_Woody,
if you want to clip the globe/terrain, you will need a number of clippingPlanes (each plane is one “edge” of the hole), or a polygon for which the planes are calculated.
After that its just a matter of
viewer.scene.globe.clippingPlanes = new Cesium.ClippingPlaneCollection({...})
.
Have a look at this Sandcastle, in which you can draw a hole into tileset + terrain.
Best, Lennart
hmm, Nothing change when i draw a hole, can you check again?
It’s working for me:
left click for drawing the points of polygon
right click to draw/finalize the hole/polygon
i used right click then point was removed
It’s working for me now, but How can I clip the whole 3Dtileset when the hole/polygon goes through it?
Maybe you could calculate a midpoint of the polygon and pick the feature or the tileset at this midpoint (viewer.scene.pick
with viewer.scene.cartesianToCanvasCoordinates
) and set its show
property to false. I hope I understood you correctly there.
Sadly (for now at least) Cesium does not support multiple clippingPlaneCollections for globe
. You can only have 1 single hole (which has to be concave to be flawless).
oh, so sad, Why do I have to draw for the 3rd time before the hole is created? I tried to recheck many times, had to draw 3 times to work
for example if i have 2 or more overlapping 3dtiles, will the hole be able to clip all the 3dtiles?
Because the hole is a surface/area and thus needs a minimum of 3 points/corners. Or do you mean something else?
If you set the created clippingPlaneCollection for all of them, it should work
I don’t know whats going on there, for me it’s working normally. Sadly, I don’t know the author of this Sandcastle, I just stumbled across it sometime.
thank you , let me check again
why when i change my 3dtile it wont clipping? My example
for some 3dtilesets I’ve created, I have to use a different modelMatrix
for the clippingPlaneCollection
:
Cesium.Matrix4.inverse(
…Cesium.Transforms.eastNorthUpToFixedFrame(tileset.boundingSphere.center),
…new Cesium.Matrix4())
Maybe that helps, but I think thats related to the software I am using to generate the tilesets (FME).
it’s confusing, my 3dtile is the same as the 3dtile format in the example can you fix it in my example?
I’ve changed the modelMatrix and for me its looking ok now.
it’s working for me, thank you for your support have a great day!
How can I clipping Model glb? in my example where am i going wrong?