|
楼主 |
发表于 2024-6-9 09:21:04
|
显示全部楼层
本帖最后由 tzbm123456 于 2024-6-9 09:51 编辑
<Entity移动>
2024年06月9日
// 绘制BoxGraphics
entity = viewer.entities.add({
position: Cartesian3.fromDegrees(-75.59777, 40.03883),
box: new BoxGraphics({
dimensions: new Cartesian3(400000.0, 300000.0, 500000.0),
material: Cesium.Color.RED.withAlpha(0.5),
}),
});
newPosition = Cartesian3.fromDegrees(-75.59777, 40.03883,200000);
entity.position = newPosition
// 绘制polygon
redPolygon = viewer.entities.add({
name: "Red polygon on surface",
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray([
-115.0,
37.0,
-115.0,
32.0,
-107.0,
33.0,
-102.0,
31.0,
-102.0,
35.0,
]),
material: Cesium.Color.RED,
extrudedHeight: 50000,
arcType: Cesium.ArcType.GEODESIC,
},
});
cyanPolygon = viewer.entities.add({
name: "Cyan vertical polygon with per-position heights and outline",
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([
-90.0,
41.0,
0.0,
-85.0,
41.0,
500000.0,
-80.0,
41.0,
0.0,
]),
perPositionHeight: true,
material: Cesium.Color.CYAN.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
});
|
|