1. A concise explanation of the problem you’re experiencing.
how to apply ElevationContour Material to the polygon entity?
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
terrainProvider: Cesium.createWorldTerrain({
requestVertexNormals: true //Needed to visualize slope
})
});
var material = Cesium.Material.fromType(‘ElevationContour’);
var contourUniforms = material.uniforms;
contourUniforms.width = 2.0;
contourUniforms.spacing = 5.0;
contourUniforms.color = Cesium.Color.RED;
var scene = viewer.scene;
var instance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-100.0, 20.0, -90.0, 30.0),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
});
scene.primitives.add(new Cesium.Primitive({
geometryInstances : [instance],
appearance : new Cesium.EllipsoidSurfaceAppearance({
material : material
})
}));
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
**i want to **apply ElevationContour or ElevationRamp or SlopeRamp to the fixed region(picture1) instead of whole globe (picture2).
4. The Cesium version you’re using, your operating system and browser.
CE V 1.50
Chrome V 60