CesiumGS/3d-tiles

Question: Reference implementation for Region bounding volumes?

gkjohnson opened this issue · 4 comments

Hello!

I'm working towards support region bounding volumes in my 3d-tiles implementation and I seem to recall awhile ago that I read that a reference implementation for region calculations was provided but I can no longer find where I saw that. Perhaps I'm misremembering?

Either way is there any documentation on a recommended approach for implementing the required bounds functions for regions? Specifically I'm interested in the following functions:

  • Distance from point to region
  • Frustum intersects region
  • Maybe as an added optimization bonus: compute an oriented bounding box / sphere from a region

Thanks!
Garrett

Hi @gkjohnson, take a look at TileBoundingRegion.js in CesiumJS

Thanks @lilleyse! From that file it looks like just the oriented bounds are used for plane intersection -- am I right in understanding that frustum intersection doesn't use the precise region bounds, then, and instead uses the larger oriented bounds that encapsulates the region? Is that for performance?

And if that's the case is there a significant benefit to using region bounds rather than an oriented bounding box for a tile? At large lat / lon spans the precise distance between a region and the OBB could be significantly different which would effect the apparent error estimate but when a region spans smaller angles the OBB should be almost the same, right?

Thanks again for your help!

Yes, the CesiumJS implementation computes an oriented bounding box from the region for frustum culling but uses the region itself for distance checks which is important for getting a precise screen space error.

At smaller scales OBBs and regions should approximate each other pretty closely.

Great thank you @lilleyse!