Hello,
Yes, there are two different ways to accomplish this. You can either specify a height for the entire polygon, or have heights for each position and set perPositionHeight to true.
Here’s an example of both in Sandcastle:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var perPosHeight = viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0,
-115.0, 32.0, 100000.0,
-107.0, 33.0, 0,
-102.0, 31.0, 100000.0,
-102.0, 35.0, 100000.0 ]),
perPositionHeight: true,
material : Cesium.Color.RED
}
});
var constantHeight = viewer.entities.add({
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-115.0, 47.0,
-115.0, 42.0,
-107.0, 43.0,
-102.0, 41.0,
-102.0, 45.0 ]),
height: 100000,
material : Cesium.Color.BLUE
}
});
viewer.zoomTo(viewer.entities);
``
There is information for using these properties in CZML in the CZML content page polygon documentation.
Best,
Hannah