I am looking at for plotting data in the elevation dimension, this would be useful for things like plotting temperature with respect to elevation ect …
I am exploring a couple of options, one with walls, the other is with polygons. In google earth I used polygons
Any comments on which one would be more efficient for cesium to render, issues, or future solutions ect… would be appreciated
One thing I noticed is that the polygon approach has issues with a geometry that crosses over or comes into contact with itself
(note the point with longitude = -115.0009999, using -115.0010 causes issues )
the following should run in sandbox
var viewer = new Cesium.Viewer(‘cesiumContainer’) ;
var step = 1,
top = new Cesium.Cartographic.fromDegrees(-115.0010, 44.0, 36.0),
bottom = new Cesium.Cartographic.fromDegrees(-115.0010, 44.0, 12.0);
var points = [
new Cesium.Cartographic.fromDegrees(-115.0006, 44.0, 36.0),
new Cesium.Cartographic.fromDegrees(-115.0003, 44.0, 35.0),
new Cesium.Cartographic.fromDegrees(-115.0009, 44.0, 34.0),
new Cesium.Cartographic.fromDegrees(-115.0007, 44.0, 33.0),
new Cesium.Cartographic.fromDegrees(-115.0007, 44.0, 32.0),
new Cesium.Cartographic.fromDegrees(-115.0006, 44.0, 31.0),
new Cesium.Cartographic.fromDegrees(-115.0000, 44.0, 30.0),
new Cesium.Cartographic.fromDegrees(-115.0004, 44.0, 29.0),
new Cesium.Cartographic.fromDegrees(-115.0003, 44.0, 28.0),
new Cesium.Cartographic.fromDegrees(-115.0002, 44.0, 27.0),
new Cesium.Cartographic.fromDegrees(-115.0006, 44.0, 26.0),
new Cesium.Cartographic.fromDegrees(-115.0003, 44.0, 25.0),
new Cesium.Cartographic.fromDegrees(-115.0006, 44.0, 24.0),
new Cesium.Cartographic.fromDegrees(-115.0009999, 44.0, 23.0),
new Cesium.Cartographic.fromDegrees(-115.0009, 44.0, 22.0),
new Cesium.Cartographic.fromDegrees(-115.0007, 44.0, 21.0),
new Cesium.Cartographic.fromDegrees(-115.0007, 44.0, 20.0),
new Cesium.Cartographic.fromDegrees(-115.0006, 44.0, 19.0),
new Cesium.Cartographic.fromDegrees(-115.0000, 44.0, 18.0),
new Cesium.Cartographic.fromDegrees(-115.0004, 44.0, 17.0),
new Cesium.Cartographic.fromDegrees(-115.0003, 44.0, 16.0),
new Cesium.Cartographic.fromDegrees(-115.0002, 44.0, 15.0),
new Cesium.Cartographic.fromDegrees(-115.0006, 44.0, 14.0),
new Cesium.Cartographic.fromDegrees(-115.0003, 44.0, 13.0)];
points.forEach(
function(p, i){
viewer.entities.add({
wall : { positions : [
Cesium.Cartesian3.fromRadians(top.longitude- 0.00002, top.latitude , p.height + step/2 ),
Cesium.Cartesian3.fromRadians(p.longitude- 0.00002, p.latitude , p.height + step/2 )
],
minimumHeights : [p.height - step/2 , p.height - step/2 ],
material : Cesium.Color.RED
}
});
}
);
points.push(bottom);
points.push(top);
var p = viewer.entities.add({
polygon : {
hierarchy : (ellipsoid.cartographicArrayToCartesianArray(points)),
material : Cesium.Color.BLUE,
perPositionHeight : true
}
});
viewer.zoomTo(viewer.entities);