美文网首页
Cesium添加Primitive虚线

Cesium添加Primitive虚线

作者: 周五蛋碎一地 | 来源:发表于2023-01-05 13:04 被阅读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, 
              }),
            }),
          })

相关文章

网友评论

      本文标题:Cesium添加Primitive虚线

      本文链接:https://www.haomeiwen.com/subject/aoxjcdtx.html