Cesium.js学习第二天(立方体)

Posted _Lawrence

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cesium.js学习第二天(立方体)相关的知识,希望对你有一定的参考价值。

var viewer = new Cesium.Viewer(‘cs‘);
// viewer.entities.add({//正方形
// position:Cesium.Cartesian3.fromDegrees(-9300,1000,1400),
// box:{
// dimensions:new Cesium.Cartesian3(800000.0, 800000.0,800000.0),
// material:‘/img/cesium.png‘
// }
// })
// viewer.entities.add({//球体
// position: Cesium.Cartesian3.fromDegrees(-300,100,400),
// ellipsoid:{
// radii :new Cesium.Cartesian3(800000.0, 800000.0,800000.0),
// material:‘/img/cesium.png‘
// }
// })
// viewer.entities.add({//圆柱
// position: Cesium.Cartesian3.fromDegrees(-300,100,400),
// cylinder :{
// length : 400000.0,
// topRadius : 200000.0,
// bottomRadius : 200000.0,
// material : Cesium.Color.GREEN.withAlpha(0.5),
// outline : true,
// outlineColor : Cesium.Color.DARK_GREEN//
// }
// })
// viewer.entities.add({//圆锥
// position: Cesium.Cartesian3.fromDegrees(116.423241,43.920026, 200000.0),
// cylinder : {
// length : 400000.0,
// topRadius : 0.0,
// bottomRadius : 200000.0,
// material : Cesium.Color.RED
// }
// })
viewer.entities.add({
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray([
-197.0, 231.0,
-97.0, 339.0,
-87.0, 359.0,
-8237.0, 31.0]),
height : 500000,//多边形高度
material : Cesium.Color.RED.withAlpha(1),//红色不透明
outline : true,
outlineColor : Cesium.Color.ORANGE//橘色轮廓线
}
})
viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([-75, 35,
-125, 35]),
width : 5,
material : Cesium.Color.RED
}
});

viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([-75, 37,
-125, 37]),
width : 10,
material : new Cesium.PolylineGlowMaterialProperty({
glowPower : 0.2,//发光强度的属性,以总线宽度的百分比表示。
color : Cesium.Color.BLUE
})
}
});

viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 39, 250000,
-125, 39, 250000]),
width : 5,
material : new Cesium.PolylineOutlineMaterialProperty({
color : Cesium.Color.ORANGE,
outlineWidth : 2,
outlineColor : Cesium.Color.BLACK
})
}
});

viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 43, 500000,
-125, 43, 500000]),
width : 10,
followSurface : false,
material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.PURPLE)
}
});

viewer.entities.add({//蓝色多边形
polygon : {
hierarchy : {
positions : Cesium.Cartesian3.fromDegreesArray([-99.0, 30.0,
-85.0, 30.0,
-85.0, 40.0,
-99.0, 40.0]),
holes : [{
positions : Cesium.Cartesian3.fromDegreesArray([
-97.0, 31.0,
-97.0, 39.0,
-87.0, 39.0,
-87.0, 31.0
]),
holes : [{
positions : Cesium.Cartesian3.fromDegreesArray([
-95.0, 33.0,
-89.0, 33.0,
-89.0, 37.0,
-95.0, 37.0
]),
holes : [{
positions : Cesium.Cartesian3.fromDegreesArray([
-93.0, 34.0,
-91.0, 34.0,
-91.0, 36.0,
-93.0, 36.0
])
}]
}]
}]
},
material : Cesium.Color.BLUE.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.BLACK
}
});

viewer.entities.add({//绿色多边形
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([-108.0, 42.0,
-100.0, 42.0,
-104.0, 40.0]),
extrudedHeight: 500000.0,
material : Cesium.Color.GREEN,
closeTop : false,
closeBottom : false
}
});












































































































































以上是关于Cesium.js学习第二天(立方体)的主要内容,如果未能解决你的问题,请参考以下文章

冲刺第二天

python学习第二天

第二天-起步

2018-10-10学习python第二天

python绝技学习笔记第二天

python学习第二天