1.碎片数据下载
2.处理数据
和处理卫星数据一致。
3.批量创建卫星碎片
其实创建方式和卫星一样
var issPoint = new Sgp4Propagator(tleList).CreatePoint();
var debris = new Platform
{
Name = tleList.Name,
LocationPoint = issPoint,
OrientationAxes = new AxesVehicleVelocityLocalHorizontal(m_earth.FixedFrame, issPoint),
};
debris.Extensions.Add(new IdentifierExtension(tleList.Name));
//PointGraphics 在没有加载图片和模型的情况下,可以 指定碎片为一个原点。
debris.Extensions.Add(new PointGraphicsExtension(new PointGraphics
{
Color = new ConstantCesiumProperty<Color>(STKUtil.GetColors(i)), 根据id随机获取颜色的一个函数
PixelSize = 4.0,//指定点的大小。还有别的一些参数自行进行设置。
}));
4.创建海南区域
扣去海南地图经纬度
点越多越完整。
private void CreateHaiNan()
{
var poitList = GetTracksData("Area/hainan.txt");//处理数据
DrawingHaiNanArea(poitList, "hainan");
}
根据坐标区域地图绘制区域,之前也说过。
public void DrawingHaiNanArea(List<Cartographic> poitList, string strName)
{
// With the boundary nodes specified and the reference surface chosen,
// we now decide on the granularity of the interconnecting curves.
double granularity = Trig.DegreesToRadians(0.5);
var builder = new SpecifiedNodesEllipsoidSurfaceRegionBuilder(m_earth.Shape, granularity, poitList);
// The default connection type is geodesic, but rhumb lines could be used instead if desired.
builder.ConnectionType = EllipsoidSurfaceRegionCurveConnectionType.Geodesic;
// The region is ready to be built!
var region = builder.GetEllipsoidSurfaceRegion();
var locationPoint = new PointCartographic(m_earth, region.Centroid);
m_AreaHaiNan = new Platform
{
Name = strName,
LocationPoint = locationPoint,
OrientationAxes = new AxesEastNorthUp(m_earth, locationPoint),
};
m_AreaHaiNan.Extensions.Add(new IdentifierExtension("Area"));
CentralBodySurfaceRegion m_region = new CentralBodySurfaceRegion(m_earth, region);
m_AreaHaiNan.Extensions.Add(m_region);
// Configure graphical display of the sensor dome.
m_AreaHaiNan.Extensions.Add(new CentralBodySurfaceRegionGraphicsExtension(new CentralBodySurfaceRegionGraphics
{
Material = new StripeMaterialGraphics
{
//EvenColor = Color.Blue,
OddColor = Color.White,
Repeat = 16.0,
},
}));
}
效果