Fixing the GLTF model w.r.t ground

Hi,

When I am overlaying the GTLF model using the following code, the model is loaded however its position with respect to ground is not fixed and keeps on changing when we zoom-in or zoom-out. please suggest where I am doing wrong.

//B27 version being used

var rotateX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(0)), Cesium.Cartesian3.ZERO);

var modelMatrix = Cesium.Matrix4.multiply(Cesium.Transforms.eastNorthUpToFixedFrame(ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(val[1],val[0],0))), rotateX);

var model = scene.primitives.add(Cesium.Model.fromGltf({

url : ‘models/1.json’,

modelMatrix : modelMatrix,

scale : 1.0

}));

//val[1] and val[0] are the longitude and latitude values

Hi,

I would not expect that. Have you tried the 3D model example in Sandcastle? Do those models appear to move? Perhaps that example can provide some insight.

http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html&label=Showcases

Patrick

Hi,

yes. I tried to overlay “rambler” model given in the gallery folder of gltf branch. This also appears to move in my viewer.

However the same rambler model (and also my model) appears to be ok in the default gltf branch viewer

Ref- https://groups.google.com/forum/#!msg/cesium-dev/soK05NfUuM8/3J_3Zv7773EJ

https://github.com/AnalyticalGraphicsInc/cesium/tree/gltf

Should i need to switch over to B29 to resolve this?

Thanks

Hi,

I migrated my application to B29. the models are working fine. I don’t know what was the problem with previous version codes.

Thanks.