Set 3dtileset clamp( up on tileset)

Hi, I get some porblem when i tried to set 3dtileset clamp to ground.
I loaded the 3dtileset and tried to set it clamp to ground by

var cartographic = Cesium.Cartographic.fromCartesian(
var surface = Cesium.Cartesian3.fromRadians(
var offset = Cesium.Cartesian3.fromRadians(
var translation = Cesium.Cartesian3.subtract(
new Cesium.Cartesian3()
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);

and I found the tileset in the underground(because the tileset boundSphere center is some distance above the model rather than in the center of the model).
how could i set it to clamp ground correctly?


Are you using a terrain, or just the plain ellipsoid? It very often comes down to accuracy, of your models and of your terrain (if you got one).

If you use a terrain and it’s accurate, you can probably sample your way to the right height (let terrain load, then sample height at the boundingSphere, add model, sample again, and adjust height according to the difference in height between the two), but if you don’t it’s always a bit tricky because you need to know at what height your model looks fine on the ellipsoid. Some tilesets come with a min and max height property, so if you know the min you can always try to transform it to that.

in my world, our customers most often have very accurate models / tilesets, so they will always match up nicely to accurate terrain models. It’s mostly non-accurate data that’s an issue. And remember that there’s a difference between a visual representation of data, and an accurate working with data. If you’re doing measurements on inaccurate data, your measurements will equally be inaccurate.



thanks for reply.
I didn’t set any terrain( just the plain ellipsoid)
I haven’t find any code solution to solve it.
Maybe the center only could be reset by modeling software such as Blander.
I’ll try it