//##################################################################### /// <summary> /// 根据星历表,创建新的PathPrimitive</para> /// </summary> /// <param name="ephemeris">卫星星历数据</param> /// <param name="frame">参考系</param> public static PathPrimitive CreatePathPrimitiveFromEphemeris(DateMotionCollection <Cartesian> ephemeris, ReferenceFrame frame) { try { List <PathPoint> points = new List <PathPoint>(); for (int i = 0; i < ephemeris.Count; i++) { points.Add(new PathPointBuilder(ephemeris.Values[i], ephemeris.Dates[i], Color.Yellow).ToPathPoint()); } PathPrimitive pathPrimitive = new PathPrimitive(); //pathPrimitive.UpdatePolicy = new DurationPathPrimitiveUpdatePolicy(new Duration(0, 60), PathPrimitiveRemoveLocation.RemoveLocationFront); pathPrimitive.ReferenceFrame = frame; //pathPrimitive.AddRangeToFront(points); pathPrimitive.AddRangeToBack(points); pathPrimitive.Width = 3.0F; SceneManager.Animation.Time = ephemeris.Dates[0]; return(pathPrimitive); } catch (Exception ex) { throw new Exception(ex.Message + "\n" + "向3D图中画卫星轨迹出错!"); } }