3d-tiles & Clipping Planes

Ok, so the reason it wasn’t working was because tileset.root.computedTransform was actually identity (the root tile doesn’t have a transform). It gets its location on the surface of the earth from an RTC transform (relative to center).

Since what we really want here is to reverse the clipping plane’s matrix so that its coordinates are relative to the center of the earth, we can just invert the tileset._initialClippingPlanesOriginMatrix:

tileset.clippingPlanes = new Cesium.ClippingPlaneCollection({

planes : clippingPlanes,

unionClippingRegions : true,

edgeColor: Cesium.Color.WHITE,

modelMatrix: Cesium.Matrix4.inverse(tileset._initialClippingPlanesOriginMatrix, new Cesium.Matrix4())

});

``

Sandcastle link.

Unrelated, but I had trouble with the Shift+Q and clicking out a polygon. It seems like the polygon positions aren’t computed correctly? For example, here’s the result of clicking out a polygon on the surface:

The last two positions seem to be way underground when tilting the camera.