问题描述
addRectangularsensor() {
this.viewer.scene.primitives.removeAll();
var rectangularPyramidSensor = new CesiumSensorVolumes.RectangularPyramidSensorVolume();
rectangularPyramidSensor.modelMatrix = this.getModelMatrix();
rectangularPyramidSensor.radius = 50000.0;
rectangularPyramidSensor.xHalfAngle = Cesium.Math.toradians(45);
rectangularPyramidSensor.yHalfAngle = Cesium.Math.toradians(30);
rectangularPyramidSensor.lateralSurfaceMaterial = Cesium.Material.fromType('Color');
rectangularPyramidSensor.lateralSurfaceMaterial.uniforms.color = new Cesium.Color(0.0,1.0,0.5);
rectangularPyramidSensor.intersectionColor = Cesium.Color.YELLOW
rectangularPyramidSensor.debugShowCrossingPoints = true;
rectangularPyramidSensor.showIntersection = true;
console.log('rectangularPyramidSensor',rectangularPyramidSensor)
console.log('rectangularPyramidSensor.modelMatrix',rectangularPyramidSensor.modelMatrix)
this.viewer.scene.primitives.add(rectangularPyramidSensor);
console.log('this.viewer.scene.primitives',this.viewer.scene.primitives)
},getModelMatrix() {
var longitude = Cesium.Math.toradians(34.862923);
var latitude = Cesium.Math.toradians(31.996851);
var altitude = 2000.0;
var clock = 0.0;
var cone = Cesium.Math.toradians(15.0);
// var cone = 0.0;
var twist = 0.0;
var ellipsoid = this.viewer.scene.globe.ellipsoid;
var location = ellipsoid.cartographicToCartesian(new Cesium.Cartographic(longitude,latitude,altitude));
var modelMatrix = Cesium.Transforms.northEastDownToFixedFrame(location);
var orientation = Cesium.Matrix3.multiply(
Cesium.Matrix3.multiply(Cesium.Matrix3.fromrotationZ(clock),Cesium.Matrix3.fromrotationY(cone),new Cesium.Matrix3()),Cesium.Matrix3.fromrotationX(twist),new Cesium.Matrix3()
);
const globe = this.viewer.scene.globe;
return Cesium.Matrix4.multiply(modelMatrix,Cesium.Matrix4.fromrotationTranslation(orientation,Cesium.Cartesian3.ZERO),new Cesium.Matrix4());
},
如何获取此传感器的交互坐标(角) 我想在此传感器的突起上绘制一些图像或视频
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)