Problems with rendering region volume

Hi everyone!

I am using 3d-tiles and cesium for rendering city buildings models on the surface of globe. When using 3d-tile with box volume, model renders perfectly, but when trying the same tile with region volume, it leaves space empty, even though camera focuses on necessary geographical location and debug shows tile box.

Here is tile file:
{
    "asset": {
        "version": "1.0"
    },
    "geometricError": 500,
    "root": {
        "boundingVolume": {
            "region": [
                0.444468247681207,
                1.1346713051502226,
                0.4445153359764694,
                1.134718393445485,
                0,
                42
            ]
        },
        "geometricError": 250,
        "refine": "REPLACE",
        "content": {
            "url": "Building1_2.b3dm"
        },
        "children":
    }
}

And here is code for rendering:

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
            url: url
        }));

tileset.readyPromise.then(function (tileset) {
            viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
            viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
        })

I am using cesium 1.41 on Windows 10 in latest Firefox/Chrome.

I appreciate if somebody would help or guide me in this issue.
Thanks!

That tileset does look ok at a quick glance. A lot of the sample 3D Tilesets use regions fine so I’m not sure why it’s giving you trouble.

Would you mind sending me the tileset so I could try and debug it? You can email it to me at slilley@agi.com.

Thanks for sending the files.

The problem is the transform is positioning the tile’s content far away from where the actual tile is. The region bounding volume type can’t actually get transformed (https://github.com/AnalyticalGraphicsInc/cesium/issues/5984), so the content moves but the tile does not. If you set the transform to something closer to where the region is you should see the content show up.

For example, I used this code to apply a better transform to the root tile. Your tileset writer could generate the transform in a similar way.

tileset.readyPromise.then(function() {

var boundingSphere = tileset.boundingSphere;

var center = boundingSphere.center;

var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, new Cesium.HeadingPitchRoll());

tileset._root.transform = transform;

viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius / 4.0));

viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

}).otherwise(function(error) {

throw(error);

});

``

A huge thanks to you! :slight_smile: