public CModel Create(int i) { Model model; CModel cmodel = null; if (i == 1) { model = Content.Load <Model>("watcher"); cmodel = new CModel(model, aspectRatio, 120, 0); } else if (i == 2) { model = Content.Load <Model>("Liberty"); cmodel = new CModel(model, aspectRatio, 25, 700); } else if (i == 3) { model = Content.Load <Model>("earth"); cmodel = new CModel(model, aspectRatio, 200, 0); } else if (i == 4) { model = Content.Load <Model>("HouseLow"); cmodel = new CModel(model, aspectRatio, 500, -1500); } return(cmodel); }
public void LoadContent() { synth.SetOutputToDefaultAudioDevice(); aspectRatio = graphics.GraphicsDevice.Viewport.AspectRatio; loadmodel = new LoadModel(aspectRatio, graphics, Content); cmodel = loadmodel.Create(4); }
public void update() { KeyboardState newState = Keyboard.GetState(); //tourne gauche if (newState.IsKeyDown(Keys.Left)) { cmodel.tourGauche(); } //tourne droite if (newState.IsKeyDown(Keys.Right)) { cmodel.tourDroite(); } //zoom ++++ if (newState.IsKeyDown(Keys.Up)) { cmodel.zoomPlus(); } //zoom ---- if (newState.IsKeyDown(Keys.Down)) { cmodel.zoomMoin(); } //son globe if (newState.IsKeyDown(Keys.D) && i == 3) { float angleview = cmodel.PosiZ; string speak = cmodel.echo(angleview); synth.Speak(speak); } if (newState.IsKeyDown(Keys.D) && i == 2) { synth.Speak("La statue de la Liberté , est l'un des monuments les plus célèbres des États-Unis. Cette statue monumentale est située à New York, sur l'île de Liberty Island au sud de Manhattan, à l'embouchure de l'Hudson et à proximité d'Ellis Island."); } // load watcher if (newState.IsKeyDown(Keys.Space) && i != 1) { cmodel = loadmodel.Create(1); i = 1; } // load statut if (newState.IsKeyDown(Keys.Space) && i != 2) { cmodel = loadmodel.Create(2); i = 2; } // load globe if (newState.IsKeyDown(Keys.Space) && i != 3) { cmodel = loadmodel.Create(3); i = 3; } }