Test intersection with Tileset bounds

Hi, as pictured below, I have added controls to the viewer to allow users to interactively select a section of a displayed 3d tileset. (marked by the blue polylines).

The screenshot contains a simple example of marking a selected area where the viewer contains a single tileset. (with debugShowBoundingVolume toggled on).

In more complex cases, we may have multiple tilesets loaded, and I need to be able to detect which tilesets intersect with the area that has been selected so that I can perform some processing only on the tilesets that intersect with the selected area.

Would anybody be able to advise on the best approach to identify how to identify the intersects between the selected area and the bounds of the tileset(s)?

The approach I had hoped to use, was to compute an Oriented Bounding Box using the cartesian coordinates at each of the corners of the selected area, and then identify if that box intersects with any of the bounding volumes of the loaded tilesets. However, this doesn’t appear to be something that is supported by any of the Intersection Tests that are available.

Does this sound along the right lines, or is there a better approach? Thanks for any help.

Hi there,

I think you’re on the right track! We actually implement a similar computation for culling volumes and clipping planes-- We need to determine whether a tile’s bounding volume intersects or is fully inside those volumes in order to determine whether they should be loaded or rendered.

I think it should be fairly straightforward to convert your box into a CullingVolume, from which you can then use computeVisibility to determine the intersection with a tileset bounding volume. But let us know if you run into any problems there.