Sign in to follow this  


Recommended Posts

Upinflames    122
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
GuyWithBeard    1892

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


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this