All tiles excluded when a clipping CesiumPolygonRasterOverlay has both "Invert Selection" and "Exclude Selected Tiles"
corybarr opened this issue · comments
To reproduce, use Google Photorealistic 3D Tiles and the coordinates provided in the Cesium for Omniverse: Tileset Clipping
tutorial.
Default CesiumPolygonRasterOverlay
settings look good:
When "Invert Selection" is enabled, no tiles are rendered:
If "Invert Selection" is enabled and "Exclude Selected Tiles" is disabled, the inverted clip looks good:
I'm seeing the same behavior while adding this capability to CesiumPolygonRasterOverlays
in the Omniverse extension.
with Cesium for Unreal 2.2.0
The problem seems to be that estimateGlobeRectangle
(in BoundingVolume.cpp
) does a very poor job of estimating the bounding region for an oriented bounding box that encompasses the entire globe. The root tile of Google Photorealistic 3D Tiles has an oriented bounding box located at the center of the Earth and with three axis-aligned half-axes of about 8 million meters each. So that definitely encompasses the entire Earth. But estimateGlobeRectangle
comes up with a nonsense answer that only extends to +/- 135 degrees longitude and +/- 35 degrees latitude. If the polygon is located entirely outside that box, then the root tile will be excluded, and nothing will render at all.
Could you check if the oriented bounding box contains the center point (0, 0, 0) and if so return a full rectangle?
Looking at the code a bit there will probably be other inaccuracies (after all it's called estimateGlobeRectangle
) but maybe this is enough to unblock the issue with Google's data?
Yeah something like that would probably work as a quick fix for this specific issue.