Issue with 3d tiles.

I tried to upload a gml by converting it to 3dtiles. It was successful.But the data is in the air since the gml file has some elevation in it.So i have to manually adjust the offset to bring the tiles to ground.Is there any way to adjust the tiles height to align with the ground automatically.Is there any property like clamp to ground for tiles.Or is there any way to automatically adjust the offset while loading of tiles.

I assume you’re using Cesium ion (https://cesium.com/ion/). We’ve actually just released a tool to help position tilesets like this! If you select your asset under the “My Assets” tab, in the preview window on the right you should see an “Adjust Tileset Location” tab which should look you move, position and scale the tileset.

Alternatively, you can manually move the tileset after it’s in CesiumJS by using the modelMatrix of the tileset. Check out this Sandcastle example:

Omar is mostly right, but the Tileset Location tool is not compatible with CityGML generated tilesets yet (support it planned).

The best solution is to tell ion to clamp your data at the time of upload. You can do this by enabled Clamp to terrain and then selecting the terrain you want to use. This will automatically adjust the height of ground-based object types so they sit on the terrain.

image.png

Thanks for the reply Matthew i was successful in adjusting the tileset by using modelmatrix. The tiles got on the terrain.I tried with cesium ion also i got correct result.But i want to use the clamptoground property in the api itself instead of using the ion.

Is there any option to clamp the tiles to ground while loading the tiles.

Unfortunately not. What makes 3D Tiles scale so well is that all of the heavy processing is done during the tiling process. Adjusting the height of every building at run time would be incredibly inefficient and in many cases unusable. That being said, this is a feature I would love to see and we definitely plan on researching possible solutions in the future. For the time being, clamping at tile time is the only real option.

Instead of adjusting the height of every building cant we adjust the offset of tiles during the runtime,by calculating the height between the tiles and terrain.Is this possible during runtime?

Unfortunately not. What makes 3D Tiles scale so well is that all of the heavy processing is done during the tiling process. Adjusting the height of every building at run time would be incredibly inefficient and in many cases unusable. That being said, this is a feature I would love to see and we definitely plan on researching possible solutions in the future. For the time being, clamping at tile time is the only real option.

Thanks for the reply Matthew i was successful in adjusting the tileset by using modelmatrix. The tiles got on the terrain.I tried with cesium ion also i got correct result.But i want to use the clamptoground property in the api itself instead of using the ion.

Is there any option to clamp the tiles to ground while loading the tiles.

You received this message because you are subscribed to the Google Groups “cesium-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I think the issue is that the height from each building to the underlying terrain is going to be different, so there’s no correct offset you can move the entire tileset that will clamp correctly.

If you really do want to try this though, Gabby had this Sandcastle from another project for clamping individual buildings in a tileset to the terrain.

You can see that it iterates over all the tiles, samples the terrain height, and pushes the tile’s up or down. I think the only thing to be aware of is that clamps each tile, which may have more than one building each.

Thanks for the reply Omar.I used the sample you shared but only some tiles got aligned to terrain and some submerged into the terrain.I used the cesium ion clamp to terrain property it gave the correct result,all the tiles aligned properly.

Thanks for providing Cesium Ion.