I can create a wall wall with the base at elevation 0 and add it to the entities collection, but when I try to create a wall with a base height > 0 with WallGeometry it does not add to the entities collection with a visible entry.
Does anyone have an example how to add a WallGeometry to the enities collection? I can't find one in the documentation.
entities.add(GetWall(ar.polygon, elevation, ar.wall.wallHeight, ar.wall.matWall));
This GetWall function works, but the elevation (the base of the wall) is not used
function GetWall(polygon, elevation, height, material) {
var cartesians = ;
for (idx = 0; idx < polygon.length; idx++) {
cartesians.push(new Cesium.Cartesian3.fromDegrees(polygon[idx].lng, polygon[idx].lat, height));
}
// Since this is a wall, need to readd the first point at the end of the wall to close it
cartesians.push(cartesians[0]);
return new Object( { positions: cartesians, material: material });
}
This get wall function doesn't work. I'm sure it is because WallGeometry is not valid to use as the positions property but I can't find any
documentation on how to use a WallGeometry for adding a wall geometry to entities.
function GetWall(polygon, elevation, height, material) {
var cartesians = ;
for (idx = 0; idx < polygon.length; idx++) {
cartesians.push(new Cesium.Cartesian3.fromDegrees(polygon[idx].lng, polygon[idx].lat));
}
// Since this is a wall, need to read the first point at the end of the wall to close it
cartesians.push(cartesians[0]);
var wallg = Cesium.WallGeometry.fromConstantHeights({
positions : cartesians,
minimumHeight: elevation,
maximumHeight: elevation + height
});
return new Object({ poistions: wallg, material: material });
}