Exemplo n.º 1
0
 public Sphere(double radius, SphereColor color, Position3D position, String name)
 {
     Radius = radius;
     Color = color;
     CurrentPosition = position;
     Name = name;
 }
Exemplo n.º 2
0
 public Sphere()
 {
     Radius = 0;
     Color = new SphereColor();
     Name = "";
     CurrentPosition = new Position3D(0, 0, 0);
 }
Exemplo n.º 3
0
 public Eye(Position3D position, Position3D lookAt, SpatialAngle up)
 {
     _position = position;
     _lookAt = lookAt;
     _up = up;
     LookingAt = null;
     LookingFrom = null;
 }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
0
        public void DrawSpace(List<StarSystem> systems)
        {
            _systems = systems;

            // Start the main loop.  glutMainLoop never returns.
            //Glut.glutEnterGameMode();
            //Glut.glutFullScreen();

            stars = new List<BackgroundStar>();
            Random r = new Random();
            int f = Convert.ToInt32(systems[0].Star.Planets.Last().Orbit.Ecliptic.MeanRadius);
            for (int i = 0; i < 200; i++)
            {
                Position3D p = new Position3D(new SpatialAngle(r.Next(), r.Next()), r.Next(5*f, 10*f));
                stars.Add(new BackgroundStar(Convert.ToInt32(p.X), Convert.ToInt32(p.Y), Convert.ToInt32(p.Z)));
            }
            Glut.glutMainLoop();
        }
Exemplo n.º 6
0
 private void SetEyePosition()
 {
     Position3D position = _eye.Position;
     Position3D lookAt = _eye.LookAt;
     Position3D vUp = new Position3D(0, 0, 0);
     vUp.Distance = 1;
     vUp.Angle = _eye.Up;
     Glu.gluLookAt(position.X, position.Y, position.Z, lookAt.X, lookAt.Y, lookAt.Z, vUp.X, vUp.Y, vUp.Z);
 }
Exemplo n.º 7
0
 private static void goToPosition(Position3D p)
 {
     Gl.glTranslated(p.X, p.Y, p.Z);
 }
Exemplo n.º 8
0
 private static float[] getFloatArrayOfCoordinates(Position3D position)
 {
     float[] pos = { position.X.ToFloat(), position.Y.ToFloat(), position.Z.ToFloat(), 1.0f };
     return pos;
 }
Exemplo n.º 9
0
 public Star()
 {
     StartPosition = new Position3D(0, 0, 0);
     Shinines = 0;
     Planets = new List<Planet>();
 }
Exemplo n.º 10
0
 public Eye()
 {
     Position = new Position3D();
     LookAt = new Position3D();
     Up = new SpatialAngle();
 }