Sign in to follow this  
emforce

How to create a D3DXMatrix

Recommended Posts

hi guys i was wondering how i would change a Square from just a set of drawn vertices to a matrix so i could translate and rotate it?

Share this post


Link to post
Share on other sites
well i was trying to translate my square but how would i do that?

for instance i have a class Car, and an mCar object of the class car. And i want to take input in and translate

for example

DXDMatrixTranslate(&mCar,x,y,z);

but how would i make it so that mCar is a matrix to traslate?

Share this post


Link to post
Share on other sites
I think that you're thinking about this the wrong way. A matrix is just used to store your position, rotation, and scaling values. In order to use that to translate your car object you need to multiply each vertex by that matrix. You can do this in directx by setting your world matrix to the matrix you've built using D3DXMatrixTranslation.

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