Zoom to tileset (content volume instead of bounding volume)

Hi there,
we are currently running into an issue with the zoomTo function for tilesets. By default, the zoom seems to be based on the bounding volume of a tileset. Creating tileset with Agisoft Metashape, however, leads to bounding volumes significantly larger than the actual content volume.
Is there any way of using the zoomTo function to zoom to the actual content of a tileset rather than the extent of the largest bounding volume of the tileset?
In short, we would like to zoom to the blue box instead of the white one seen in the screenshot.
Thanks a lot in advance!

Hi there,

It’d be possible to zoom to the bounding sphere of the relevant tile.

You would iterate through the tree of tiles starting at the tileset root tile. Then, once you’ve identified the relevant tile, use tile.contentBoundingVolume.boundingSphere to get the tighter fitting bounding sphere.

That bounding sphere can be used as input to Camera.flyToBoundingSphere.

Hope that helps!

Thanks a lot for your reply! Actually, this approach seems to work quite well.
Cheers

1 Like