예제 #1
0
 public Sphere(Sphere sp)
 {
     this.Radius = sp.Radius;
     this.Name = sp.Name;
     this.Color = sp.Color;
     this.CurrentPosition = sp.CurrentPosition;
 }
예제 #2
0
 public Planet(Sphere sp, double reflectivity, Rotation rotation, Orbit orbit, List<Ring> rings)
     : base(sp)
 {
     Reflectivity = reflectivity;
     Orbit = orbit;
     Satelites = new List<Planet>();
     CurrentRotationAngle = 0;
     Rotation = rotation;
     double ecc = (Math.Pow(Math.Sin(Orbit.StartAngle) + 1, 3) * Orbit.Ecliptic.Eccentricity * 0.5);
     double dist = Orbit.Ecliptic.MeanRadius * (1 + ecc);
     CurrentPosition = new Position3D(new SpatialAngle(Orbit.StartAngle, 0), dist);
     Rings = rings;
 }
예제 #3
0
        private Star CreateStarFromData(StarData data, float distanceSc, float StarSc, float planetSc, float moonDistSc)
        {
            Orbit orbit = new Orbit(data.DaysForRevolution, new Ecliptic(data.DistanceFromCenter,data.EclipticEccentrity), new SpatialAngle(data.EclipseAngleX, data.EclipticInclination), data.StartAngle);
            Sphere sphere = new Sphere(data.Radius / StarSc, data.Color, new Position3D(new SpatialAngle(0, data.StartAngle), data.DistanceFromCenter / distanceSc), data.Name);
            Star star = new Star(sphere, data.Shinines);
            star.Orbit = orbit;

            if (data.Planets != null)
            {
                foreach (PlanetData planet in data.Planets)
                {
                    star.Planets.Add(CreatePlanetFromData(planet, distanceSc, planetSc, moonDistSc));
                }
            }

            return star;
        }
예제 #4
0
        private Planet CreatePlanetFromData(PlanetData data, float distanceScale, float planetScale, float moonDistSc)
        {
            Sphere sphere = new Sphere(data.Radius / planetScale, data.Color, data.Name);
            Orbit orbit = new Orbit(data.DaysForRevolution, new Ecliptic(data.DistanceFromCenter/distanceScale, data.EclipticEccentrity), new SpatialAngle(data.EclipticAngleX * Math.PI / 180f, data.EclipticInclination * Math.PI / 180f), data.StartAngle*Math.PI/180f);
            Rotation rotation = new Rotation(data.HoursForRotation, 0, new SpatialAngle(data.TiltAngleX * Math.PI / 180f, data.TiltAngleUP * Math.PI / 180f));
            Planet planet = new Planet(sphere, data.Reflectivity, rotation, orbit, CreateRingsFromData(data.Rings, planetScale));

            if (data.Satelites != null)
            {
                foreach (PlanetData moon in data.Satelites)
                {
                    planet.Satelites.Add(CreatePlanetFromData(moon, distanceScale/moonDistSc, planetScale, moonDistSc));
                }
            }
            return planet;
        }
예제 #5
0
 private void drawSphere(Sphere sphere)
 {
     if (wireModel)
     {
         Glut.glutWireSphere(sphere.Radius, 30, 30);
     }
     else
     {
         Glut.glutSolidSphere(sphere.Radius, 50, 50);
     }
 }
예제 #6
0
 public Star(Sphere sp, double shinines)
     : base(sp)
 {
     Shinines = shinines;
     Planets = new List<Planet>();
 }