Пример #1
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;
 }
Пример #2
0
        private void OperazioniSelezionePianeta()
        {
            mouse.Acquire();

            switch (CambiaPianeta)
            {
                case 1:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        hd1 = true;
                    }
                    APunto(Mercurio.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        PianetaSelezionato = Mercurio;
                    }
                    break;
                case 2:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 7000;
                        hd2 = true;
                    }
                    APunto(Venere.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 7000;
                        PianetaSelezionato = Venere;
                    }
                    break;
                case 3:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 7000;
                        hd3 = true;
                    }
                    APunto(Terra.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 7000;
                        PianetaSelezionato = Terra;
                    }
                    break;
                case 4:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 5000;
                        hd4 = true;
                    }
                    APunto(Luna.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 5000;
                        PianetaSelezionato = Terra;
                    }
                    break;
                case 5:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 7000;
                        hd5 = true;
                    }
                    APunto(Marte.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 7000;
                        PianetaSelezionato = Marte;
                    }
                    break;
                case 6:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 3500;
                        hd6 = false;
                    }
                    APunto(Phobos.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 3500;
                        PianetaSelezionato = Marte;
                    }
                    break;
                case 7:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 4000;
                        hd7 = false;
                    }
                    APunto(Deimos.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 4000;
                        PianetaSelezionato = Marte;
                    }
                    break;
                case 8:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 12000;
                        hd8 = true;
                    }
                    APunto(Giove.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 12000;
                        PianetaSelezionato = Giove;
                    }
                    break;
                case 9:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        hd9 = true;
                    }
                    APunto(Io.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        PianetaSelezionato = Giove;
                    }
                    break;
                case 10:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        hd10 = true;
                    }
                    APunto(Europa.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        PianetaSelezionato = Giove;
                    }
                    break;
                case 11:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        hd11 = true;
                    }
                    APunto(Ganimede.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        PianetaSelezionato = Giove;
                    }
                    break;
                case 12:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        hd12 = true;
                    }
                    APunto(Callisto.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 6000;
                        PianetaSelezionato = Giove;
                    }
                    break;
                case 13:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 12000;
                        hd13 = true;
                    }
                    APunto(Saturno.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 12000;
                        PianetaSelezionato = Saturno;
                    }
                    break;
                case 14:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 12000;
                        hd14 = true;
                    }
                    APunto(Urano.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 12000;
                        PianetaSelezionato = Urano;
                    }
                    break;
                case 15:
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 10000;
                        hd15 = true;
                    }
                    APunto(Nettuno.position, 40, 60, -mouse.DistanceLookPosition);
                    if (stop == true)
                    {
                        mouse.DistanceForCameraTrackBall = 10000;
                        PianetaSelezionato = Nettuno;
                    }
                    break;
                case 16:
                    CambiaPianeta = 15;
                    break;
            }

            if (stop == false)
            {
                switch (CambiaPianeta)
                {
                    case 1:
                        if (hdEnable)
                        {
                            hd1 = true;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Mercurio.position);
                        PianetaSelezionato = Mercurio;
                        cam.NearPlane = 1.5f;
                        break;
                    case 2:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = true;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Venere.position);
                        PianetaSelezionato = Venere;
                        cam.NearPlane = 2;
                        break;
                    case 3:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = true;
                            hd4 = true;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Terra.position);
                        PianetaSelezionato = Terra;
                        cam.NearPlane = 2;
                        break;
                    case 4:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = true;
                            hd4 = true;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Luna.position);
                        PianetaSelezionato = Terra;
                        hd4 = true;
                        cam.NearPlane = 1;
                        break;
                    case 5:
                        GuardaPunto(Marte.position);
                        PianetaSelezionato = Marte;
                        cam.NearPlane = 2;
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = true;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        break;
                    case 6:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = true;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Phobos.position);
                        PianetaSelezionato = Marte;
                        cam.NearPlane = 0.05f;
                        break;
                    case 7:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = true;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Deimos.position);
                        PianetaSelezionato = Marte;
                        cam.NearPlane = 0.05f;
                        break;
                    case 8:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = true;
                            hd9 = true;
                            hd10 = true;
                            hd11 = true;
                            hd12 = true;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Giove.position);
                        PianetaSelezionato = Giove;
                        cam.NearPlane = 10;
                        break;
                    case 9:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = true;
                            hd9 = true;
                            hd10 = true;
                            hd11 = true;
                            hd12 = true;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Io.position);
                        PianetaSelezionato = Giove;
                        cam.NearPlane = 2;
                        break;
                    case 10:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = true;
                            hd9 = true;
                            hd10 = true;
                            hd11 = true;
                            hd12 = true;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Europa.position);
                        PianetaSelezionato = Giove;
                        cam.NearPlane = 2;
                        break;
                    case 11:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = true;
                            hd9 = true;
                            hd10 = true;
                            hd11 = true;
                            hd12 = true;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Ganimede.position);
                        PianetaSelezionato = Giove;
                        cam.NearPlane = 2;
                        break;
                    case 12:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = true;
                            hd9 = true;
                            hd10 = true;
                            hd11 = true;
                            hd12 = true;
                            hd13 = false;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Callisto.position);
                        PianetaSelezionato = Giove;
                        cam.NearPlane = 2;
                        break;
                    case 13:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = true;
                            hd14 = false;
                            hd15 = false;
                        }
                        GuardaPunto(Saturno.position);
                        PianetaSelezionato = Saturno;
                        cam.NearPlane = 10;
                        break;
                    case 14:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = true;
                            hd15 = false;
                        }
                        GuardaPunto(Urano.position);
                        PianetaSelezionato = Urano;
                        cam.NearPlane = 10;
                        break;
                    case 15:
                        if (hdEnable)
                        {
                            hd1 = false;
                            hd2 = false;
                            hd3 = false;
                            hd4 = false;
                            hd5 = false;
                            hd6 = false;
                            hd7 = false;
                            hd8 = false;
                            hd9 = false;
                            hd10 = false;
                            hd11 = false;
                            hd12 = false;
                            hd13 = false;
                            hd14 = false;
                            hd15 = true;
                        }
                        GuardaPunto(Nettuno.position);
                        PianetaSelezionato = Nettuno;
                        cam.NearPlane = 13;
                        break;
                    case 16:
                        CambiaPianeta = 15;
                        break;
                }
            }
        }
Пример #3
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;
 }
Пример #4
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;

            }
        }