I made a 3dtiles sample.with gltfUpAxis=Z. When loading it in cesiumJS, I can see the tile shows up but disappear immediately. While rotating the camera,the tile may appear sometimes. I guess it is relate to some kind of culling mechanism. Could anyone tell me what i miss in my 3dtiles sample? Thanks
var viewer = new Cesium.Viewer("cesiumContainer", {
imageryProvider: new Cesium.UrlTemplateImageryProvider({
url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
}),
});
const tileset = new Cesium.Cesium3DTileset({
url: 'http://127.0.0.1:8080/Ezha2_output/tileset.json',
});
console.log(tileset);
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);
It’s hard to tell from a short (“2D”) screengrab. But it looks like that tile might just be below the surface.
When you create the viewer with
var viewer = new Cesium.Viewer("cesiumContainer", {
globe: false
});
(i.e. without imagery and without the globe), do you see the tileset?
If this is the case, then this could be solved by moving that tileset up a little, either by setting the tileset.modelMatrix, or modifying the root transform in the tileset JSON file.
Dragging-and-dropping this into the glTF-Validator at glTF Validator reports several errors. The most relevant here are those of the category
{
"code": "ACCESSOR_MIN_MISMATCH",
"message": "Declared minimum value for this component (-1.9738363027572632) does not match actual minimum (-5.023843288421631).",
"severity": 0,
"pointer": "/accessors/0/min/0"
},
{
"code": "ACCESSOR_ELEMENT_OUT_OF_MIN_BOUND",
"message": "Accessor contains 36 element(s) less than declared minimum value -1.9738363027572632.",
"severity": 0,
"pointer": "/accessors/0/min/0"
},
So the glTF is invalid, because its bounding box size cannot be determined. And with an invalid glTF, there is no guarantee that it can be rendered properly - neither by CesiumJS nor by other viewers.
You said…
I made a 3dtiles sample.with gltfUpAxis=Z.
There are two questions:
1.) Why did you try to change things so that they need the gltfUpAxis=Z?
There is most likely no good reason to do that. Changing the orientation of the glTF can be tricky - it’s sometimes hard to get the coordinate transforms right. Additionally, the gltfUpAxis property is not part of the 3D Tiles specification. So other 3D Tiles viewers may not even support the gltfUpAxis property, meaning that you might not be able to render this tileset in other viewers.
I’d strongly recommend to not transform it in a way that requires the gltfUpAxis=Z. But if you think that this is necessary:
2.) How did you modify the glTF asset to change its orientation?