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 () {
 更多参考 https://xiaozhuanlan.com/topic/3748102965
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值