How to create a D3DXMatrix

Started by
2 comments, last by Dancin_Fool 14 years, 8 months ago
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?

Game Development Tutorials - My new site that tries to teach LWJGL 3.0 and OpenGL to anyone willing to learn a little.

Advertisement
What do you mean?
You could use a matrix to translate and rotate your square.
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?

Game Development Tutorials - My new site that tries to teach LWJGL 3.0 and OpenGL to anyone willing to learn a little.

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.

This topic is closed to new replies.

Advertisement