i new in cesium, czml , javascript, trying create pyramid polygon base on ground. have latitude , longitude height of top point, have angle of each side. couldn't find method create yet. there way can create in czml file?
i'm not sure if can done 1 single packet. however, can done 1 single czml object. go website: http://cesiumjs.org/cesium/apps/sandcastle/index.html
and paste in code below. give starting point. may wish change opacity if dont want see-through. , may wish remove outline of polygon edges if dont want see how built pyramid out of multiple polygons.
the "pyramid" made 3 sided. extend include many sides wish.
var czml = [ { "id" : "document", "name" : "czml geometries: polygon", "version" : "1.0" }, { "id" : "orangepolygon", "name" : "orange polygon per-position heights , outline", "polygon" : { "positions" : { "cartographicdegrees" : [ -70.0, 35.0, 100000, -72.0, 37.0, 0, -68.0, 35.0, 0 ] }, "material" : { "solidcolor" : { "color" : { "rgba" : [255, 100, 0, 100] } } }, "extrudedheight" : 0, "perpositionheight" : true, "outline" : true, "outlinecolor" : { "rgba" : [0, 0, 0, 255] } } }, { "id" : "orangepolygon2", "name" : "orange polygon per-position heights , outline", "polygon" : { "positions" : { "cartographicdegrees" : [ -70.0, 35.0, 100000, -70.0, 33.0, 0, -68.0, 35.0, 0 ] }, "material" : { "solidcolor" : { "color" : { "rgba" : [255, 100, 0, 100] } } }, "extrudedheight" : 0, "perpositionheight" : true, "outline" : true, "outlinecolor" : { "rgba" : [0, 0, 0, 255] } } }, { "id" : "orangepolygon3", "name" : "orange polygon per-position heights , outline", "polygon" : { "positions" : { "cartographicdegrees" : [ -70.0, 35.0, 100000, -70.0, 33.0, 0, -72.0, 37.0, 0, ] }, "material" : { "solidcolor" : { "color" : { "rgba" : [255, 100, 0, 100] } } }, "extrudedheight" : 0, "perpositionheight" : true, "outline" : true, "outlinecolor" : { "rgba" : [0, 0, 0, 255] } } } ]; var viewer = new cesium.viewer('cesiumcontainer'); var datasource = cesium.czmldatasource.load(czml); viewer.datasources.add(datasource); viewer.zoomto(datasource);
Comments
Post a Comment