Cesium雷达扫描线效果

更多精彩内容尽在 dt.sim3d.cn ,关注公众号【sky的数孪技术】,技术交流、源码下载请添加VX:digital_twin123

ezgif-7-a26128d767.gif
源码如下:

var viewer = new Cesium.Viewer("cesiumContainer");
        var scene = viewer.scene;

        var matGLSL =
          "#define L length(c - .1*vec2(    // use: L x,y)) \n" +
          "#define M(v)   max(0., v) \n" +
          "czm_material czm_getMaterial(czm_materialInput materialInput) \n" +
          "{ \n" +
          "czm_material m = czm_getDefaultMaterial(materialInput);\n" +
          "vec2 uv = materialInput.st; \n" +
          "vec2 c = uv+uv - 1.0, \n" +
          "k = .1-.1*step(.007,abs(c)); \n" +
          "float x = L 0))*25., // x,y - polar coords \n" +
          "iTime = czm_frameNumber * 0.01, \n" +
          "y = mod(atan(c.y, c.x)+iTime, 6.28), \n" +
          "d = M(.75 - y * .4), \n" +
          "b = min( min(L -3,-1)), L 6,-4)) ), L 4,5)) ) + .06 - y * .04; \n" +
          "float result = (x < 24. ? .25 + M(cos(x + .8) - .95) * 8.4 + k.x + k.y + d * d+ M(.8 - y * (x + x + .3)): 0.) \n" +
          "+ M(1. - abs(x + x - 48.)); \n" +
          "m.diffuse = vec3(0.0, result, 0.1); \n" +
          "m.alpha = result; \n" +
          "return m; \n" +
          "} \n";

        var myMat = new Cesium.Material({
          fabric: {
            type: "RadarMaterial",
            source: matGLSL,
          },
        });

        var primitive = new Cesium.Primitive({
          geometryInstances: new Cesium.GeometryInstance({
            geometry: new Cesium.RectangleGeometry({
              rectangle: Cesium.Rectangle.fromDegrees(100.0, 31.0, 110.0, 39.0),
              vertexFormat: Cesium.VertexFormat.ALL,
            }),
          }),
          appearance: new Cesium.EllipsoidSurfaceAppearance({
            material: myMat,
          }),
        });

        // Add instances to primitives
        scene.primitives.add(primitive);

        viewer.camera.setView({
          destination: Cesium.Cartesian3.fromDegrees(105.0, 35.0, 4500000.0),
        });
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

搞GIS图形的sky.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值