Hello,
The goal of my little side project is to show buildings (extruded polygons) draped over a terrain.
I have been able to add a terrain mesh, a geoJSON of the "building footprints" to the map. Screenshot here: http://imgur.com/TocZDMT
Now I want to extrude the polyons. following is my code to generate the extrusions
var allGeometryInstances = ;
// loop over the polygon features
// create a degreesArray for the polygon feature geojson
var degreesArray = coordsToDegreesArray(curFeat['geometry']['coordinates'][0])
var extrudedPolygon = new Cesium.PolygonGeometry({
polygonHierarchy : new Cesium.PolygonHierarchy(
Cesium.Cartesian3.fromDegreesArray(degreesArray)
),
extrudedHeight: 40
});
var polygonInstance = new Cesium.GeometryInstance({
geometry : extrudedPolygon,
id : randomid(),
attributes:{
color: new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
}
});
allGeometryInstances.push(polygonInstance);
and finally:
scene.primitives.add(new Cesium.GroundPrimitive({
geometryInstances : allGeometryInstances
}));
When I run this code, the height is not rendered. What am I missing?
Hrishi