Esempio n. 1
0
 public CieloStellato()
 {
     model = new Model("MEDIA//satellite.x", 0);
     EffectPool pool = new EffectPool();
     effect = Effect.FromFile(LogiX_Engine.Device, "MEDIA//NightSky.fx", null, ShaderFlags.None, pool);
     effectHandles = new EffectHandle[6];
     effectHandles[0] = effect.GetTechnique("t0");
     effectHandles[1] = effect.GetParameter(null, "matViewProjection");
     effectHandles[2] = effect.GetParameter(null, "Time");
     effectHandles[3] = effect.GetParameter(null, "BaseTexture");
     effectHandles[4] = effect.GetParameter(null, "NoiseTexture");
     effectHandles[5] = effect.GetParameter(null, "TexDimension");
     baseTexture = new BaseTexture[2];
     baseTexture[0] = TextureLoader.FromFile(LogiX_Engine.Device, "MEDIA//StarMap1.jpg");
     baseTexture[1] = TextureLoader.FromFile(LogiX_Engine.Device, "MEDIA//Noise.jpg");
 }
Esempio n. 2
0
 public Sole()
 {
     model = new Model("MEDIA//Sfera5.x", 0);
     EffectPool pool = new EffectPool();
     effect = Effect.FromFile(LogiX_Engine.Device, "MEDIA//Sun.fx", null, ShaderFlags.None, pool);
     effectHandles = new EffectHandle[5];
     effectHandles[0] = effect.GetTechnique("t0");
     effectHandles[1] = effect.GetParameter(null, "matViewProjection");
     effectHandles[2] = effect.GetParameter(null, "Time");
     effectHandles[3] = effect.GetParameter(null, "Texture");
     effectHandles[4] = effect.GetParameter(null, "TexDimension");
     baseTexture = TextureLoader.FromFile(LogiX_Engine.Device, "MEDIA//N030.jpg");
     Alone = new XMaterial(Color.White, Color.White, Color.Black, 1);
     light = new DirectionalLight(VertexData.Empty, Color.FromArgb(60, 10, 0), Color.FromArgb(255, 170, 100), Color.FromArgb(250, 250, 250));
 }
Esempio n. 3
0
 public Satellite(Pianeta Pianeta, float DistanzaDalPianetaInMigliaiaKm, float RaggioInKm, float InclinazioneAsse, float PeriodoDiRotazioneInGiorni, float PeriodoDiRivoluzioneInGiorni, XTexture Texture, string NomeDelSatellite, Model Model)
 {
     pianeta = Pianeta;
     nomeSatellite = NomeDelSatellite;
     model = Model;
     distanzaDalPianeta = DistanzaDalPianetaInMigliaiaKm;
     periodoRotazione = PeriodoDiRotazioneInGiorni;
     periodoRivoluzione = PeriodoDiRivoluzioneInGiorni;
     inclinazioneAsse = InclinazioneAsse;
     raggio = RaggioInKm;
     texture = Texture;
     isdefault = false;
     position = VertexData.Empty;
 }
Esempio n. 4
0
 public Satellite(Pianeta Pianeta, float DistanzaDalPianetaInMigliaiaKm, float RaggioInKm, float InclinazioneAsse, float PeriodoDiRotazioneInGiorni, float PeriodoDiRivoluzioneInGiorni, XTexture Texture, string NomeDelSatellite)
 {
     pianeta = Pianeta;
     nomeSatellite = NomeDelSatellite;
     model = new Model("MEDIA//satellite.x", 0);
     model1 = new Model("MEDIA//sfera4.x", 0);
     distanzaDalPianeta = DistanzaDalPianetaInMigliaiaKm;
     periodoRotazione = PeriodoDiRotazioneInGiorni;
     periodoRivoluzione = PeriodoDiRivoluzioneInGiorni;
     inclinazioneAsse = InclinazioneAsse;
     raggio = RaggioInKm;
     texture = Texture;
     isdefault = true;
     position = VertexData.Empty;
 }
Esempio n. 5
0
 public void CreaAnelli(XTexture TextureBase, XTexture TexturePattern)
 {
     anelli = new Model("MEDIA\\ring.x", 0);
     textureAnelli = TextureBase;
     textureAnelliPattern = TexturePattern;
     EffectPool pool = new EffectPool();
     effect = Effect.FromFile(LogiX_Engine.Device, "MEDIA\\anelli.fx", null, ShaderFlags.None, pool);
     effectHandles = new EffectHandle[5];
     effectHandles[0] = effect.GetTechnique("t0");
     effectHandles[1] = effect.GetParameter(null, "matViewProjection");
     effectHandles[2] = effect.GetParameter(null, "matWorld");
     effectHandles[3] = effect.GetParameter(null, "colorTex");
     effectHandles[4] = effect.GetParameter(null, "alphaTex");
 }
Esempio n. 6
0
 public Pianeta(float DistanzaDalSoleInMilioniKm, float RaggioInKm, float InclinazioneAsse, float PeriodoDiRotazioneInGiorni, float PeriodoDiRivoluzioneInGiorni, XTexture Texture, string NomeDelPianeta)
 {
     nomePianeta = NomeDelPianeta;
     model = new Model("MEDIA//satellite.x",0);
     model1 = new Model("MEDIA//sfera4.x", 0);
     distanzaDalSole = DistanzaDalSoleInMilioniKm;
     periodoRotazione = PeriodoDiRotazioneInGiorni;
     periodoRivoluzione = PeriodoDiRivoluzioneInGiorni;
     inclinazioneAsse = InclinazioneAsse;
     raggio = RaggioInKm;
     texture = Texture;
     position = VertexData.Empty;
 }
Esempio n. 7
0
        private void SetObjects()
        {
            //lxe.SetAutoEngine(this, true);
            //lxe.SetManualEngine(this, LogiX_Engine.CurrentDisplayHeight, LogiX_Engine.CurrentDisplayWitdh, LogiX_Engine.CurrentDisplayRefreshRate, Format.X8R8G8B8, 0, SwapEffect.Discard, DeviceType.Hardware, CreateFlags.SoftwareVertexProcessing, MultiSampleType.FourSamples);
            lxe.SetManualEngine(this, 0, SwapEffect.Discard, DeviceType.Hardware, CreateFlags.SoftwareVertexProcessing, MultiSampleType.FourSamples);

            cam = new Camera(new VertexData(0,0,-1000), VertexData.Empty, new VertexData(0,1,0),(float)Math.PI/4, 2.0f, 10000000000, 1);

            //cam.AspectRatio = (float)LogiX_Engine.CurrentDisplayWitdh / (float)LogiX_Engine.CurrentDisplayHeight;
            cam.AspectRatio = (float)this.ClientSize.Width / (float)this.ClientSize.Height;
            mouse = new Mouse(this);
            mouse.DistanceForCameraTrackBall = 7000;
            cam.FieldOfView = 2 * (float)Math.PI / 6;
            keyboard = new Keyboard(this);

            Sole = new Sole();
            sunlight = new PointLight(new VertexData(0, 0, 0), Color.FromArgb(50, 50, 50), Color.FromArgb(15,15,15), Color.OrangeRed, 10000000000000000000);
            sunlight.Attenuation0 = 1;
            lxe.SetRenderState(XTeam.LogiX_Technologies.RenderStates.Solid);
            Terra = new Pianeta(149.6f, 6370, 0.48f, 1, 365, new XTexture("MEDIA\\texterrahd.jpg"), "Terra");
            Venere = new Pianeta(108, 6052, 0, -117, 224.70059f, new XTexture("MEDIA\\venusmap.jpg"), "Venere");
            Mercurio = new Pianeta(57.909f, 2440, 0, 58.6462f, 87.969f, new XTexture("MEDIA\\mercury.jpg"), "Mercurio");
            Marte = new Pianeta(228, 3392.8f, 0, 1.025957f, 686.979f, new XTexture("MEDIA\\mars.jpg"), "Marte");
            Giove = new Pianeta(778.412f, 71492, 0, 0.413538021f, 4333.2867f, new XTexture("MEDIA\\jupiter.jpg"), "Giove");
            Saturno = new Pianeta(1426.725413f, 60268, 0.47f, 0.449375f, 10756.1995f, new XTexture("MEDIA\\saturn.jpg"), "Saturno");
            Urano = new Pianeta(2870.972220f, 25559, 1.71f, -0.71875f, 30685.55f, new XTexture("MEDIA\\uranus.jpg"), "Urano");
            Nettuno = new Pianeta(4498.252900f, 24764, 0.49f, 0.67125f, 60223.3528f,new XTexture("MEDIA\\neptune.jpg"), "Nettuno");
            Luna = new Satellite(Terra, 384.400f, 1738, 0, 28, 28, new XTexture("MEDIA\\texlunahd.jpg"), "Luna");
            Phobos = new Satellite(Marte, 9.377f, 200, 0, 1, 0.2916666f, new XTexture("MEDIA\\texphobos.jpg"), "Phobos", new Model("MEDIA\\phobos.x", 0));
            Deimos = new Satellite(Marte, 23.460f, 200, 0, 0.31891023f, 0.31891023f, new XTexture("MEDIA\\deimos.jpg"), "Deimos", new Model("MEDIA\\deimos.x", 0));
            Io = new Satellite(Giove, 421.700f, 1821.3f, 0, 1.769137786f, 1.769137786f, new XTexture("MEDIA\\io.jpg"), "Io");
            Europa = new Satellite(Giove, 671.034f, 1560.8f, 0, 3.551181041f, 3.551181041f, new XTexture("MEDIA\\europa.jpg"), "Europa");
            Ganimede = new Satellite(Giove, 1070.400f, 2631.2f, 0, 7.15455296f, 7.15455296f, new XTexture("MEDIA\\ganimede.jpg"), "Ganimede");
            Callisto = new Satellite(Giove, 1882.700f, 2410.3f, 0, 16.6890184f, 16.6890184f, new XTexture("MEDIA\\callisto.jpg"), "Ganimede");

            Sky = new CieloStellato();
            info = new PrintScreen("arial", 16);
            PianetaSelezionato = Terra;
            mod = new Model("MEDIA\\Sfera4.x", 0);
            RingColor = new XTexture("MEDIA\\saturnringcolor.jpg");
            RingPattern = new XTexture("MEDIA\\saturnringpattern.jpg");
            Saturno.CreaAnelli(RingColor, RingPattern);
            Urano.CreaAnelli(new XTexture("MEDIA\\uranusringcolour1.jpg"), new XTexture("MEDIA\\uranusringtrans.png"));

            if (!hdEnable)
            {
                hd1 = hd2 = hd3 = hd4 = hd5 = hd6 = hd7 = hd8 = hd9 = hd10 = hd11 = hd12 = hd13 = hd14 = hd15 = true;

            }
        }