How to load only 3dtiles inside the polygon?

Hello everyone, I’ve been troubled by this problem recently, I need to load 3dtiles according to polygons, but there is no longitude and latitude information in 3dtiles, I can’t filter, please help me!

It may be necessary to add a few more technical details here. On the one hand, you are right: When you access a 3D Tiles tileset that is stored on a server, then you don’t know where this tileset is located before requesting it. But as soon as you have loaded the tileset.json, you can obtain the bounding volume of the root node, and this should contain the required information. Then, the question is what it means for a tileset to be “inside” a polygon. A polygon may be a pretty arbitrary shape in space. Does this refer to a certain area on the surface? (Further, more detailed questons are whether you only want to load the data that is contained in the polygon, or whether the polygon should be used for some sort of clipping)

Thank you for your reply.
The effect I want to achieve is this: enter the map to display the building 3dtiles of a certain city, and then select a polygonal area, the building 3dtiles in the selected area will be displayed, and the buildings outside the area will not be displayed or covered by a mask.

Like this:

https://cesium.com/learn/cesiumjs/ref-doc/ClippingPlaneCollection.html?classFilter=clippin

Yes, ClippingPlaneCollection is the right keyword here.

There are some degrees of freedom for the implementation. But the basic approach would be:

  • Define the polygon
  • Create one clipping plane for each side of the polygon
  • Combine them into a clipping plane collection (important: unionClippingRegions must be true)
  • Assign that clipping plane collection to the tileset

Here is an example that shows the basic approach, with an example tileset:

But again: Note that this only visually clips away the parts outside the polygon region. It may not always affect the loading performance. (It might, but I’m not 100% sure about that…)

Thank you, it’s useful for me.