public SolarSystemProgram()
        {
            Moon  moon1 = new Moon();
            Sun   sun1  = new Sun();
            Stars stars = new Stars();
            Earth earth = new Earth();

            int month = 0;

            // The Unix epoch (or Unix time or POSIX time or Unix timestamp)
            // is the number of seconds that have elapsed since January 1, 1970
            var computerTime = Math.Round((DateTime.Now.Subtract(new System.DateTime(1970, 1, 1))).TotalDays / 365);

            for (long year = 0; year < computerTime; year++)
            {
                // Earth completes it's orbit once a year
                Planet.CompletedRotation();

                // lunar eclipse 0-3 times per year
                for (int day = 0; day < 365; day++)
                {
                    // Earth completing 1 rotation creates 1 day
                    Planet.CompletedRotation();

                    // The moon pulls tides every day
                    Moon.PullTides();
                    if (day % 30 == 0)
                    {
                        // The moon completes it's orbit and a full rotation once a month
                        Moon.CompletedOrbit();
                        Moon.CompletedRotation();
                        month++;
                    }

                    // The moon wanes and waxes mid-way
                    if (day % 15 == 0)
                    {
                        moon1.waning = !moon1.waning;
                        moon1.waxing = !moon1.waxing;
                    }
                }

                Console.WriteLine(new DateTime(1970, 1, 1).ToString("d"));

                //Light travels 300,000 kilometers per second!
                int kilometers = 300000;
                int second     = 1;

                // One lightyear is 9.5 trillion km
                // new LightYear(kilometers, second);
                var ly = new LightYear(kilometers, second);
            }
        }
Example #2
0
        public SolarSystemProgram()
        {
            Moon  moon1 = new Moon();
            Sun   sun1  = new Sun();
            Stars stars = new Stars();
            Earth earth = new Earth();

            var month = 0;

            // The Unix epoch (or Unix time or POSIX time or Unix timestamp)
            // is the number of seconds that have elapsed since January 1, 1970
            var computerTime = Math.Round((DateTime.Now.Subtract(new System.DateTime(1970, 1, 1))).TotalDays / 365);

            for (long year = 0; year < computerTime; year++)
            {
                // Earth completes it's orbit once a year
                earth.CompletedOrbit();

                // lunar eclipse 0-3 times per year
                for (int day = 0; day < 365; day++)
                {
                    // Earth completing 1 rotation creates 1 day
                    earth.CompletedRotation();

                    // The moon pulls tides every day
                    moon1.PullTides();
                    if (day % 30 == 0)
                    {
                        // The moon completes it's orbit and a full rotation once a month
                        moon1.CompletedOrbit();
                        moon1.CompletedRotation();
                        month++;
                    }

                    // The moon wanes and waxes mid-way
                    if (day % 15 == 0)
                    {
                        moon1.waning = !moon1.waning;
                        moon1.waxing = !moon1.waxing;
                    }
                }
            }
        }
        private void loadContent(PlanetParameters planetParams, ContentManager content)
        {
            this.planets = new List <Planet>();
            this.rings   = new List <PlanetRing>();

            VAO planetVao = content.GetVao("sphere");

            skybox = new SkyBox("content/textures/skybox");

            sun = new Sun("sun", planetParams, null, planetVao, content.getTexture("sun"));
            Planet mercury = new Planet("mercury", planetParams, sun, planetVao, content.getTexture("mercury"));
            Planet venus   = new Planet("venus", planetParams, sun, planetVao, content.getTexture("venus"));

            earth = new Earth("earth", planetParams, sun, planetVao, content.getTexture("earth"), content.getTexture("earth_spec"),
                              content.getTexture("earth_night"), content.getTexture("earth_normal"), content.getTexture("earth_clouds"));
            Planet moon    = new Planet("moon", planetParams, earth, planetVao, content.getTexture("moon"));
            Planet mars    = new Planet("mars", planetParams, sun, planetVao, content.getTexture("mars"));
            Planet jupiter = new Planet("jupiter", planetParams, sun, planetVao, content.getTexture("jupiter"));
            Planet saturn  = new Planet("saturn", planetParams, sun, planetVao, content.getTexture("saturn"));
            Planet uranus  = new Planet("uranus", planetParams, sun, planetVao, content.getTexture("uranus"));
            Planet neptune = new Planet("neptune", planetParams, sun, planetVao, content.getTexture("neptune"));
            Planet pluto   = new Planet("pluto", planetParams, sun, planetVao, content.getTexture("pluto"));

            //PlanetRing saturnRings = new PlanetRing(content.GetVao("saturnRings"), content.getTexture("saturnRings.png"), saturn);
            //PlanetRing uranusRings = new PlanetRing(content.GetVao("uranusRings"), content.getTexture("uranusRings.png"), uranus);

            planets.Add(mercury);
            planets.Add(venus);
            planets.Add(moon);
            planets.Add(mars);
            planets.Add(jupiter);
            planets.Add(saturn);
            planets.Add(uranus);
            planets.Add(neptune);
            planets.Add(pluto);

            //rings.Add(saturnRings);
            //rings.Add(uranusRings);
        }
Example #4
0
        protected override void Initialize()
        {
            Sun = new Sun(0, 0, 0);
            Earth = new Earth();
            Moon = new Moon();

            Children.Add(Sun);
            Children.Add(Earth);
            Children.Add(Moon);
            Children.Add(new Monitor());

            base.Initialize();
        }
        private void loadContent(PlanetParameters planetParams, Dictionary<Enums.MeshVBOs, MeshVBOs> VBOs, Dictionary<Enums.Textures, Texture> textures)
        {
            this.planets = new List<Planet>();;
            this.rings = new List<PlanetRing>();;
            this.stars = new Mesh(VBOs[Enums.MeshVBOs.planet], textures[Enums.Textures.starsT], defaultShader);
            stars.Scale = 4500f;

            MeshVBOs planetVBOs = VBOs[Enums.MeshVBOs.planet];

            sun = new Sun("sun", planetParams, null, planetVBOs, textures[Enums.Textures.sunT], sunShader, lineShader);
            Planet mercury = new Planet("mercury", planetParams, sun, planetVBOs, textures[Enums.Textures.mercury], defaultShader, lineShader);
            Planet venus = new Planet("venus", planetParams, sun, planetVBOs, textures[Enums.Textures.venusT], defaultShader, lineShader);
            Earth earth = new Earth("earth", planetParams, sun, planetVBOs, textures[Enums.Textures.earthT], textures[Enums.Textures.earth_SpecT],
                textures[Enums.Textures.earth_NightT], textures[Enums.Textures.earth_NormalT], textures[Enums.Textures.earty_CloudsT], earthShader, lineShader);
            Planet moon = new Planet("moon", planetParams, earth, planetVBOs, textures[Enums.Textures.moonT], defaultShader, lineShader);
            Planet mars = new Planet("mars", planetParams, sun, planetVBOs, textures[Enums.Textures.marsT], defaultShader, lineShader);
            Planet jupiter = new Planet("jupiter", planetParams, sun, planetVBOs, textures[Enums.Textures.jupiterT], defaultShader, lineShader);
            Planet saturn = new Planet("saturn", planetParams, sun, planetVBOs, textures[Enums.Textures.saturnT], defaultShader, lineShader);
            Planet uranus = new Planet("uranus", planetParams, sun, planetVBOs, textures[Enums.Textures.uranusT], defaultShader, lineShader);
            Planet neptune = new Planet("neptune", planetParams, sun, planetVBOs, textures[Enums.Textures.neptuneT], defaultShader, lineShader);
            Planet pluto = new Planet("pluto", planetParams, sun, planetVBOs, textures[Enums.Textures.plutoT], defaultShader, lineShader);

            PlanetRing saturnRings = new PlanetRing(VBOs[Enums.MeshVBOs.saturnRings], textures[Enums.Textures.saturn_RingsT], saturn);
            PlanetRing uranusRings = new PlanetRing(VBOs[Enums.MeshVBOs.uranusRings], textures[Enums.Textures.uranus_RingsT], uranus);

            planets.Add(sun);
            planets.Add(mercury);
            planets.Add(venus);
            planets.Add(earth);
            planets.Add(moon);
            planets.Add(mars);
            planets.Add(jupiter);
            planets.Add(saturn);
            planets.Add(uranus);
            planets.Add(neptune);
            planets.Add(pluto);

            rings.Add(saturnRings);
            rings.Add(uranusRings);

            cam = new Camera();
            cam.setFocus(sun);

            foreach (Planet p in planets)
            {
                p.DrawOrbit = true;
                p.DrawAxisTilt = true;
            }
        }
Example #6
0
        protected override void Initialize()
        {
            Setting = new Setting();
            Camera = new Camera();
            Children = new List<GameEntity>();

            Skybox = new Skybox();
            Sound = new Sound();
            Sun = new Sun(0, 0, 0);
            Earth = new Earth();
            Moon = new Moon();

            Children.Add(Sound);
            Children.Add(Sun);
            Children.Add(Earth);
            Children.Add(Moon);
            Children.Add(new SatelliteManager());
            Children.Add(new Monitor());

            base.Initialize();
        }