Jump to content
  • Advertisement
Sign in to follow this  
Upinflames

Cameras

This topic is 3773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am DirectX coder in C#.My problem is I am new to DirectX and I was wondering how I could move the world around me to make rendering the camera easier but I don't know where to start and what function I should use to do this or a formula should be used to calculate how much forward or rotation the world should do. I know this kind of makes no sense but all links would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Hi!

In simple terms, a camera in a 3D application has to provide two matrices to the API (for example D3D or OpenGL) to work. These are the view and projection matrices (and world matrix, but this is usually an identity matrix for the camera). These matrices are passed to the appropriate objects every frame. If you use the fixed-function pipeline the matrices are used to set the device transform. If you render using shaders you pass the matrices to the shaders before rendering anything.

It is probably best to create a camera class that exposes easy-to-understand concepts such as position and orientation. These vill make it easier to manipulate the camera later. However, before you create a camera class you need to fully understand how the matrices work. I recommend reading a few tutorials on the subject before worrying about making an easy-to-use camera yourself.

Riemers DX C# tutorial

//chinc

EDIT: Oh, and the tutorial above discuss the official Managed DirectX, but should work with minor modifications with SlimDX too. You did not say which one you use...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!