Trouble while applying ElevationContour to gLTF model

I am trying to apply elevation contour to a sample gLTF model . below here is the code snippet for the same.
i used the debugger option and saw the changes after commenting my model.material code i checked the material was undefined and after uncommenting the same i get some material property applied in console but its not visible on the model. !

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
animation : false,
homeButton : false,
baseLayerPicker : false,
infoBox : false,
sceneModePicker : false,
timeline : false,
navigationInstructionsInitiallyVisible : false,
navigationHelpButton : false,
});
viewer.scene.globe.enableLighting = true;
var scene = viewer.scene;
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 0.0));
var model = scene.primitives.add(Cesium.Model.fromGltf({
url : ‘Cesium_Air.glb’,
modelMatrix : modelMatrix,
scale : 20000.0
}));

model.material = new Cesium.Material({
    fabric: {
  type: "ElevationContour",
  uniforms : {
        color : new Cesium.Color(1.0, 1.0, 0.0, 1.0),
        spacing:10,
        width:1
    },
translucent: true,

}})


Hey @rahuljainnn, see my answer here: Apply materials like contour or color ramp based on elevation to a glft model. I’m closing this so we can keep the discussion in one place.

1 Like