1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| const viewer = new Cesium.Viewer("cesiumContainer");
const bluePlane = viewer.entities.add({ name: "蓝色平面", position: Cesium.Cartesian3.fromDegrees(-114.0, 40.0, 300000.0), plane: { plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0), dimensions: new Cesium.Cartesian2(400000.0, 300000.0), material: Cesium.Color.BLUE, }, });
const redPlane = viewer.entities.add({ name: "带有黑色轮廓红色平面", position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0), plane: { plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Y, 0.0), dimensions: new Cesium.Cartesian2(400000.0, 300000.0), material: Cesium.Color.RED.withAlpha(0.5), outline: true, outlineColor: Cesium.Color.BLACK, }, });
const outlineOnly = viewer.entities.add({ name: "仅有轮廓但无填充的黄色平面", position: Cesium.Cartesian3.fromDegrees(-100.0, 40.0, 300000.0), plane: { plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0.0), dimensions: new Cesium.Cartesian2(400000.0, 300000.0), fill: false, outline: true, outlineColor: Cesium.Color.YELLOW, }, });
viewer.zoomTo(viewer.entities);
|