Beispiel #1
0
    void Log()
    {
        Debug.Log("------- SUN ------- ");
        Debug.Log(string.Format("JD: {0}", dt.JulianDay()));
        Debug.Log(string.Format("Time: {0}:{1}:{2}", dt.Hour(), dt.Minute(), dt.Second()));
        skyModel.GetSun().Log();
        HourAngle H = new HourAngle(skyModel.GetSun().localHourAngle);

        Debug.Log(string.Format("H {0}", H.ToString()));

        AAS2DCoordinate local = AASCoordinateTransformation.Equatorial2Horizontal(skyModel.GetSun().localHourAngle,
                                                                                  skyModel.GetSun().EquatorialCoords.Declination.Get(),
                                                                                  location.Latitude);


        Debug.Log(string.Format("local X {0}", local.X));
        Debug.Log(string.Format("local Y {0}", local.Y));


        Debug.Log("------- VENUS ------- ");
        VenusModel venus = skyModel.GetPlanets() ["Venus"] as VenusModel;

        venus.Log();


        Debug.Log("------- MOON ------- ");
        MoonModel moon = skyModel.GetMoon();

        moon.Log();

        Debug.Log("------- JUPITER ------- ");
        JupiterModel jup = skyModel.GetPlanets()["Jupiter"] as JupiterModel;

        Debug.Log("p " + jup.GetParallacticAngle());
    }
Beispiel #2
0
	public SkyModel(double julianDay, LocationData location){
			
		if (INSTANCE == null) {
			INSTANCE = this;
		}

		this.location = location;
		this.jd =  julianDay;

		sun               = new SunModel (jd, location);
		moon        	  = new MoonModel (jd, location);
		MercuryModel mercuryModel = new MercuryModel (jd, location);
		VenusModel venusModel     = new VenusModel(jd, location);
		MarsModel marsModel       = new MarsModel (jd, location);
		JupiterModel jupiterModel = new JupiterModel (jd, location);
		SaturnModel saturnModel   = new SaturnModel (jd, location);
		UranusModel uranusModel   = new UranusModel(jd, location);
		NeptuneModel neptuneModel = new NeptuneModel(jd, location);

		planets = new Dictionary<string, PlanetModel> ();
		planets["Mercury"] = mercuryModel;
		planets["Venus"]   = venusModel;
		planets["Mars"]    = marsModel;
		planets["Jupiter"] = jupiterModel;
		planets["Saturn"]  = saturnModel;
		planets["Uranus"]  = uranusModel;
		planets["Neptune"] = neptuneModel;


		starPositionsDictionary = new Dictionary<EquatorialCoords, int> ();
		planetPositionsDictionary = new Dictionary<EquatorialCoords, PlanetModel> ();


	}
Beispiel #3
0
        /// <summary>
        ///     Se llama cada vez que hay que refrescar la pantalla.
        ///     Escribir aquí todo el código referido al renderizado.
        /// </summary>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            //Finalmente invocamos al draw del modelo.
            RasterizerState originalRasterizerState = Graphics.GraphicsDevice.RasterizerState;
            RasterizerState rasterizerState         = new RasterizerState();

            rasterizerState.CullMode = CullMode.None;
            Graphics.GraphicsDevice.RasterizerState = rasterizerState;

            skybox.Draw(View, Projection, position);

            Graphics.GraphicsDevice.RasterizerState = originalRasterizerState;



            VenusModel.Draw(World *
                            Matrix.CreateScale(.05f) *
                            Matrix.CreateRotationY(VenusRotation) *
                            Matrix.CreateTranslation(-5f, -2f, -10), View, Projection);

            // SpaceShipModel.Draw(World * Matrix.CreateScale(.8f) * Matrix.CreateRotationY(RotationY), View, Projection);

            SpaceShipModelMK1.Draw(World * //Matrix.CreateTranslation(0,-15f,0) *
                                   Matrix.CreateScale(.15f) *
                                   Matrix.CreateFromYawPitchRoll(Rotation.X, Rotation.Y, Rotation.Z) *
                                   // Rotation *
                                   Matrix.CreateTranslation(position)
                                   , View, Projection);

            SpaceShipModelMK2.Draw(World *
                                   Matrix.CreateScale(.08f) *
                                   Matrix.CreateRotationY(VenusRotation) *
                                   Matrix.CreateTranslation(4f, -2f, -10), View, Projection);

            SpaceShipModelMK3.Draw(World *
                                   Matrix.CreateScale(.08f) *
                                   Matrix.CreateRotationY(-VenusRotation) *
                                   Matrix.CreateTranslation(3f, 2f, -10), View, Projection);

            base.Draw(gameTime);
        }