Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been following a tutorial on making a free camera for a 3D model. What the camera class does is allow the player to move and rotate in respects to the model's current position using the right thumbstick of an XBox360 controller.

Here is the code:

http://pastebin.com/xb4eznMi

Can someone explain to me how to connect this to my model in my Game class?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

By quickly skimming over the code it seems to be used like this:

  class MyGame : Microsoft.Xna.Framework.Game
  {
     Camera camera;

     public MyGame()
     {
        camera = new Camera(this);
        Components.Add(camera);
     }

     // ...
     // use camera.View and camera.Projection 
  }
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.