Cesium添加Primitive虚线

2023-01-05  本文已影响0人  周五蛋碎一地

Material的type需要设置为Cesium.Material.PolylineDashType

new Cesium.Primitive({
            geometryInstances: new Cesium.GeometryInstance({
              geometry: new Cesium.PolylineGeometry({
                positions: Cesium.Cartesian3.fromDegreesArrayHeights([
                  -84.0,
                  50.0,
                  0.0,
                  -100.0,
                  30.0,
                  1000000.0,
                ]),
                width: 5.0,
                vertexFormat: Cesium.PolylineMaterialAppearance.VERTEX_FORMAT,
                arcType: Cesium.ArcType.NONE,
              }),
              attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(
                  Cesium.Color.BLUE
                ),
              },
            }),
            appearance: new Cesium.PolylineMaterialAppearance({
              material: Cesium.Material.fromType(Cesium.Material.PolylineDashType, {
                color: Cesium.Color.CYAN, 
                dashLength: 10, 
              }),
            }),
          })
上一篇 下一篇

猜你喜欢

热点阅读