Jump to content
  • Advertisement
Sign in to follow this  
emforce

How to create a D3DXMatrix

This topic is 3325 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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!