Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator - Bounding Volume Spatial Coherence #25

Open
5 of 9 tasks
lilleyse opened this issue Nov 1, 2016 · 5 comments
Open
5 of 9 tasks

Validator - Bounding Volume Spatial Coherence #25

lilleyse opened this issue Nov 1, 2016 · 5 comments

Comments

@lilleyse
Copy link
Contributor

lilleyse commented Nov 1, 2016

For CesiumGS/3d-tiles-tools#9
@sumitshyamsukha

Let's do this one now:

tile.content.boundingVolume, when defined, is completely inside tile.boundingVolume (use Cesium's functions)

There are three bounding volume types: region, box, and sphere. They are defined here: https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/schema/boundingVolume.schema.json

If a tile has a content bounding volume, check that it is inside it's bounding volume. To visualize what a bounding volume / content bounding volume looks like, go to the 3D Tiles Sandcastle when running the 3d-tiles branch in Cesium and check out the BV On/Off and Contents BV On/Off buttons.

We'll need support the following checks:

  • Region inside region
  • Box inside region
  • Sphere inside region
  • Sphere inside sphere
  • Region inside sphere
  • Box inside sphere
  • Box inside box
  • Region inside box
  • Sphere inside box

I'll update with ideas for solving some of these, but to start region inside region should be pretty straightforward. Just need to check that the west/south/east/north/min/max are within the other's values.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 1, 2016

I'll update with ideas for solving some of these, but to start region inside region should be pretty straightforward. Just need to check that the west/south/east/north/min/max are within the other's values

Please add functions to Cesium as needed.

@sumitshyamsukha
Copy link
Contributor

@lilleyse Would you like me to add this functionality to the validateTileset.js file along with the geometricError validation, or should I create a new one for all of the bounding volume validation?

@lilleyse
Copy link
Contributor Author

lilleyse commented Nov 3, 2016

Yes add it to the existing traversal in validateTileset.

@lilleyse
Copy link
Contributor Author

lilleyse commented Jul 6, 2017

@rms13 let's finish the most important ones here, starting with Box inside box.

For this it may help to reference Cesium's OrientedBoundingBox class and look at how it's created from the box array here: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Cesium3DTile.js#L828.

I think the test itself will be decomposed to eight point vs OBB checks. The OBB is basically a 2x2x2 box that is rotated and scaled by the halfAxes matrix. To do a point vs OBB check, you could apply the inverse of this matrix to the point and then check if it's in a 2x2x2 volume. (This may not be completely correct, but the right idea is somewhere in there).

@lilleyse
Copy link
Contributor Author

@rms13

Let's tackle the region tests now.

  • Box inside region
  • Sphere inside region
  • Region inside sphere
  • Region inside box

While region is technically a curved surface along the earth, I think we can assume for most cases that it is close enough to a box shape. This will heavily simplify these 4 checks.

To convert a region to a box, check out TileBoundingRegion in Cesium, specifically:

OrientedBoundingBox.fromRectangle(this.rectangle, this.minimumHeight, this.maximumHeight, ellipsoid);

Once converted to a box the previous written comparisons can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants