cesium 实现雷达波
作者:互联网
构建雷达扫描
```
// TODO 未集成
export class RadarRadiationWave {
viewer:any;
- init(map: any){
- this.viewer = map;
- this.initRadarRiationWave1();
- this.initRadarRiationWave2();
- }
- initRadarRiationWave1 () {
- var e = this.viewer.scene, i = Cesium.Cartesian3.fromDegrees(112.39, 39.9),
- a = Cesium.Cartesian3.fromDegrees(112.39, 39.9, 2e5),
- t = Cesium.Cartesian3.fromDegrees(112.39, 39.9, 4e5),
- r = Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i), new Cesium.Cartesian3(0, 0, 2e5), new Cesium.Matrix4);
- this.viewer.camera.flyToBoundingSphere(new Cesium.BoundingSphere(a, 4e5));
- e.primitives.add(new Cesium.BillboardCollection).add({
- image: "./images/svg/wave.svg",
- position: t,
- horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
- verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
- pixelOffset: new Cesium.Cartesian2(-10, 10),
- scale: .3
- });
- var n = new Cesium.CylinderGeometry({
- length: 4e5,
- topRadius: 0,
- bottomRadius: 12e4,
- vertexFormat: Cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat
- }), s = new Cesium.GeometryInstance({geometry: n, modelMatrix: r}),
- o = e.primitives.add(new Cesium.Primitive({
- geometryInstances: [s],
- appearance: new Cesium.MaterialAppearance({
- material: new Cesium.Material({
- fabric: {
- type: "VtxfShader1",
- uniforms: {
- color: new Cesium.Color(.2, 1, 0, 1),
- repeat: 30,
- offset: 0,
- thickness: .3
- },
- source: "\n uniform vec4 color;\n uniform float repeat;\n uniform float offset;\n uniform float thickness;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m);\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }\n "
- }, translucent: !1
- }), faceForward: !1, closed: !0
- })
- }));
- this.viewer.scene.preUpdate.addEventListener(function () {
标签:float,czm,实现,material,Cesium,viewer,new,cesium,雷达 来源: https://www.cnblogs.com/haibalai/p/15827461.html