STK Components 二次开发-飞行器

1.创建飞机

参数帮助文档

var poitList = GetTracksData();
var waypointPropagator = new WaypointPropagator(m_earth, poitList);
var locationPoint = waypointPropagator.CreatePoint();m_aircraft = new Platform
{Name = "MH730",LocationPoint = locationPoint,OrientationAxes = new AxesVehicleVelocityLocalHorizontal(m_earth.FixedFrame, locationPoint),
};// Set the identifier for the aircraft in the CZML document. 
m_aircraft.Extensions.Add(new IdentifierExtension("MH730"));// Hermite interpolation works better for aircraft-like vehicles.
m_aircraft.Extensions.Add(new CesiumPositionExtension
{InterpolationAlgorithm = CesiumInterpolationAlgorithm.Hermite
});// Configure a glTF model for the aircraft.
m_aircraft.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
{// Link to a binary glTF file.Model = new CesiumResource(GetModelUri("aircraft.glb"), CesiumResourceBehavior.LinkTo),// Flip the model visually to point Z in the correct direction.NodeTransformations = new Dictionary<string, NodeTransformationGraphics>{{"Aircraft", new NodeTransformationGraphics{Rotation = new UnitQuaternion(new ElementaryRotation(AxisIndicator.Third, Math.PI))}}},RunAnimations = false,
}));// Show the path of the aircraft.
m_aircraft.Extensions.Add(new PathGraphicsExtension(new PathGraphics
{Width = 2.0,LeadTime = Duration.FromHours(1.0).TotalSeconds,TrailTime = Duration.FromHours(1.0).TotalSeconds,Material = new PolylineOutlineMaterialGraphics{Color = Color.White,OutlineColor = Color.Black,OutlineWidth = 1.0,},
}));// Configure label for the aircraft.
m_aircraft.Extensions.Add(new LabelGraphicsExtension(new LabelGraphics
{Text = m_aircraft.Name,// Change label color over time.FillColor = new TimeIntervalCollection<Color>{// Green by default...TimeInterval.Infinite.AddData(Color.Red),// Red between first and second waypoints.//new TimeInterval<Color>(waypoint1.Date, waypoint2.Date, Color.Red),},// Only show label when camera is far enough from the aircraft,// to avoid visually clashing with the model.DistanceDisplayCondition = new Bounds(1000.0, double.MaxValue),
}));// Define a description for the aircraft which will be shown when selected in Cesium.
m_aircraft.Extensions.Add(new DescriptionExtension(new Description("Aircraft with two offset sensors")));

GetTracksData()函数是对自定义数据处理。其实就是经纬度。

2.飞机上也可以在添加传感器

// Create 30 degree simple conic sensor definition
var sensorCone = new ComplexConic();
sensorCone.SetHalfAngles(0.0, Trig.DegreesToRadians(15));
sensorCone.SetClockAngles(Trig.DegreesToRadians(20), Trig.DegreesToRadians(50));
sensorCone.Radius = double.PositiveInfinity;// Create a sensor pointing "forward".
// Position sensor underneath the wing.
var sensorOneLocationPoint = new PointFixedOffset(m_aircraft.ReferenceFrame, new Cartesian(-3.0, 8.0, 0.0));
var sensorAxesOne = new AxesAlignedConstrained(m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.Z), AxisIndicator.Third,m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.X), AxisIndicator.First);
// This rotation points the z-axis of the volume back along the x-axis of the ellipsoid.
var rotationOne = new UnitQuaternion(new ElementaryRotation(AxisIndicator.Second, Constants.HalfPi / 4));m_aircraftSensorOne = new Platform
{LocationPoint = sensorOneLocationPoint,OrientationAxes = new AxesFixedOffset(sensorAxesOne, rotationOne),
};// Set the identifier for the sensor in the CZML document. 
m_aircraftSensorOne.Extensions.Add(new IdentifierExtension("AircraftSensorOne"));m_aircraftSensorOne.Extensions.Add(new CesiumPositionExtension
{InterpolationAlgorithm = CesiumInterpolationAlgorithm.Hermite
});// Define the sensor geometry.
m_aircraftSensorOne.Extensions.Add(new FieldOfViewExtension(sensorCone));// Configure graphical display of the sensor.
m_aircraftSensorOne.Extensions.Add(new FieldOfViewGraphicsExtension(new SensorFieldOfViewGraphics
{// Configure the outline of the projection onto the earth.EllipsoidSurfaceMaterial = new SolidColorMaterialGraphics(Color.White),IntersectionWidth = 2.0,LateralSurfaceMaterial = new GridMaterialGraphics{Color = Color.FromArgb(171, Color.Blue),},
}));// Create sensor pointing to the "side".
// Position sensor underneath the wing.
var sensorTwoLocationPoint = new PointFixedOffset(m_aircraft.ReferenceFrame, new Cartesian(-3.0, -8.0, 0.0));
var sensorAxesTwo = new AxesAlignedConstrained(m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.Z), AxisIndicator.Third,m_aircraft.OrientationAxes.GetVectorElement(CartesianElement.Y), AxisIndicator.Second);// This rotation points the z-axis of the volume back along the x-axis of the ellipsoid.
var rotationTwo = new UnitQuaternion(new ElementaryRotation(AxisIndicator.First, Constants.HalfPi / 2));m_aircraftSensorTwo = new Platform
{LocationPoint = sensorTwoLocationPoint,OrientationAxes = new AxesFixedOffset(sensorAxesTwo, rotationTwo),
};// Set the identifier for the sensor in the CZML document. 
m_aircraftSensorTwo.Extensions.Add(new IdentifierExtension("AircraftSensorTwo"));m_aircraftSensorTwo.Extensions.Add(new CesiumPositionExtension
{InterpolationAlgorithm = CesiumInterpolationAlgorithm.Hermite
});// Define the sensor geometry.
m_aircraftSensorTwo.Extensions.Add(new FieldOfViewExtension(sensorCone));// Configure graphical display of the sensor.
m_aircraftSensorTwo.Extensions.Add(new FieldOfViewGraphicsExtension(new SensorFieldOfViewGraphics
{// Configure the outline of the projection onto the earth.EllipsoidSurfaceMaterial = new SolidColorMaterialGraphics(Color.White),IntersectionWidth = 2.0,LateralSurfaceMaterial = new GridMaterialGraphics{Color = Color.FromArgb(171, Color.Red),},
}));

效果:

传感器

同理汽车也可以根据定义的轨迹运行

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/247665.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

算符优先语法分析程序设计与实现

制作一个简单的C语言词法分析程序_用c语言编写词法分析程序-CSDN博客文章浏览阅读378次。C语言的程序中&#xff0c;有很单词多符号和保留字。一些单词符号还有对应的左线性文法。所以我们需要先做出一个单词字符表&#xff0c;给出对应的识别码&#xff0c;然后跟据对应的表格…

6、原型模式(Prototype Pattern,不常用)

原型模式指通过调用原型实例的Clone方法或其他手段来创建对象。 原型模式属于创建型设计模式&#xff0c;它以当前对象为原型&#xff08;蓝本&#xff09;来创建另一个新的对象&#xff0c;而无须知道创建的细节。原型模式在Java中通常使用Clone技术实现&#xff0c;在JavaSc…

Java架构师技术架构路线

目录 1 概论2 如何规划短中长期的技术架构路线图3 如何规划面向未来的架构4 如何修订路线图执行过程中的偏差5 如何落地路线图-阿里系糙快猛之下的敏捷模式想学习架构师构建流程请跳转:Java架构师系统架构设计 1 概论 首先,规划一个短中长期的技术路线图是非常重要的。短中…

创新领航 | 竹云参编《基层智治系统安全接入规范》团体标准正式发布!

近日&#xff0c;由杭州市委办公厅&#xff08;市密码管理局&#xff09;、杭州市基层治理综合指挥保障中心、杭州市拱墅区社会治理中心、杭州市拱墅区数据资源管理局、杭州竹云数字智能科技有限公司、杭州智诚质量标准技术评定中心共同参与编写的《基层智治系统安全接入规范》…

【Linux下如何生成coredump文件】

一&#xff0c;什么是coredump 我们经常听到大家说到程序core掉了&#xff0c;需要定位解决&#xff0c;这里说的大部分是指对应程序由于各种异常或者bug导致在运行过程中异常退出或者中止&#xff0c;并且在满足一定条件下&#xff08;这里为什么说需要满足一定的条件呢&#…

快速处理Python爬虫:异步和缓存技巧

在当今的数字化时代&#xff0c;数据是商业的核心&#xff0c;而爬虫程序是获取数据的重要工具。Python作为一种流行的编程语言&#xff0c;提供了许多库以方便快捷地创建爬虫程序。本文将探讨如何使用Python快速处理爬虫的异步和缓存技巧。 异步处理 Python的异步处理主要通…

Python小案例:打印10以内的素数

解析 1、利用循环控制范围&#xff08;1,100&#xff09; 2、通过循环判断素数 3、利用标记法进行打印素数 代码 #求1——100之间的素数 for i in range(2,101):is_primeNum Truefor j in range(2,i):if i%j 0:# print(f"{i}不是素数")is_primeNum Falseif is_…

任意文件上传漏洞实战和防范

文件上传漏洞广泛存在于Web1.0时代&#xff0c;恶意攻击者的主要攻击手法是将可执行脚本&#xff08;WebShell&#xff09;上传至目标服务器&#xff0c;以达到控制目标服务器的目的。 此漏洞成立的前提条件至少有下面两个&#xff1a; 1.可以上传对应的脚本文件&#xff0c;…

探索 SSO 的世界:简化登录流程的最佳实践(上)

&#x1f90d; 前端开发工程师&#xff08;主业&#xff09;、技术博主&#xff08;副业&#xff09;、已过CET6 &#x1f368; 阿珊和她的猫_CSDN个人主页 &#x1f560; 牛客高级专题作者、在牛客打造高质量专栏《前端面试必备》 &#x1f35a; 蓝桥云课签约作者、已在蓝桥云…

前端——html拖拽原理

文章目录 ⭐前言⭐draggable属性&#x1f496; api&#x1f496; 单向拖动示例&#x1f496; 双向拖动示例 ⭐总结⭐结束 ⭐前言 大家好&#xff0c;我是yma16&#xff0c;本文分享关于 前端——html拖拽原理。 vue3系列相关文章&#xff1a; vue3 fastapi 实现选择目录所有文…

LoadBalancer将服务暴露到外部实现负载均衡Openelb-layer2模式配置介绍

目录 一.openelb简介 二.主要介绍layer2模式 1.简介 2.原理 3.部署 &#xff08;1&#xff09;先在集群master上开启kube-proxy的strictARP &#xff08;2&#xff09;应用下载openelb.yaml&#xff08;需要修改镜像地址&#xff09; &#xff08;3&#xff09;编写yam…

mysql有哪些锁,理解各种表锁和行锁

全局锁 主要用于数据库的备份&#xff0c;但会使得备份期间不能有任何事务插入删除更新数据&#xff0c;这很影响实际业务。所以通常不用这个全局锁来完成数据库的备份。假设数据库的存储引擎支持可重复读&#xff0c;那么常见的方法是通过MVCC来实现的&#xff0c;也就是备份…