Jump to content
  • Advertisement
Sign in to follow this  
DarkEvilOne

Rotating a 3d model

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

Hey, i've been working on some code which uses D3D9 to load and display a 3ds model. So far everything is good, the code can load the models and display them fine but now i want to allow the models to be rotated/translated/scaled using the keyboard. I have code which allows the camera to be moved around on the x, y or z axis using the keyboard and the D3DXMatrixLookAtLH() function and then the LPDIRECT3DDEVICE9::SetTransform() function. I'm guessing to rotate a model on the X axis i would use D3DXMatrixRotationX() to create a matrix for the rotation, but then how would i apply this rotation to the 3d model? Cheers :)

Share this post


Link to post
Share on other sites
Advertisement
SetTransform(D3DTS_WORLD,&rotation_matrix);

Basically thats it. :)

Oh yeah, you want to render your model after you set the transform, of course.

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!