I want to create a two-layer stacking effect by setting different heights above the ground. However, from the result, it seems that the second layer is not stacked on top of the first layer but rather is covering it. What’s going on?
var latLongsx2 = [
114.232062161509, 30.5591579405355, 0,
114.232062911307, 30.5592163157103, 0,
114.232369878193, 30.5592130523243, 0,
114.232369128386, 30.5591546781422, 0,
114.232062161509, 30.5591579405355, 0
];
var latLongsx3 = [
114.232062161509, 30.5591579405355, 10,
114.232062911307, 30.5592163157103, 10,
114.232369878193, 30.5592130523243, 10,
114.232369128386, 30.5591546781422, 10,
114.232062161509, 30.5591579405355, 10
];
function showhousepic3d() {
viewer.entities.add({
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(latLongsx2),
material: Cesium.Color.BLUE.withAlpha(0.5),
extrudedHeight: 10,
outline: true,
outlineColor: Cesium.Color.RED
}
});
viewer.entities.add({
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(latLongsx3),
material: Cesium.Color.RED.withAlpha(0.5),
extrudedHeight: 20,
outline: true,
outlineColor: Cesium.Color.BLUE
}
});
}
Edited for formatting