GLTF closed to 3D Tiles

I have a dynamic gltf model on 3d tiles, and I want the model to stick on the ground

this is my code to get tiles’s height

//longitude,latitude is position of vehicle
function getGroundHeight(longitude,latitude) {

var modelPosition = Cesium.Cartesian3.fromDegrees(Number(longitude),Number(latitude));

var windowPosition = viewer.scene.cartesianToCanvasCoordinates(modelPosition,new Cesium.Cartesian2());

var tilesCartesian = viewer.scene.pickPosition(windowPosition);

var tilesPosition = viewer.scene.globe.ellipsoid.cartesianToCartographic(tilesCartesian);

var groundHeight = tilesPosition.height;

return groundHeight;

}

``

but when I move the perspective,the window position is changed,so the height of the return is not correct.

Have any ideas to solve the problem?

Unfortunately we don’t have a better solution right now. The one thing I would recommend is trying to make modelPosition as accurate as possible by sending in a height that is closer to the road’s actual height rather than the default height of 0.0.

I created an issue for clamping to 3D Tiles so that we can look into implementing better support in the future: https://github.com/AnalyticalGraphicsInc/cesium/issues/6080.

Thank you so much!
In fact, we have height data of vehicle, but the height of tiles is not accurate, so we can only seek this approach

在 2018年1月3日星期三 UTC+8上午9:53:16,Sean Lilley写道:

You is how to achieve this effect

See the previous answer in this post. The feature is coming soon.