0
\$\begingroup\$

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?

\$\endgroup\$
2
\$\begingroup\$

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 
  }
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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