Jump to content
  • Advertisement
Sign in to follow this  
Sfpiano

Rotating an object about its center

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

I know DX has a matrixRotationAxis function, but I don't know what to provide as the axis when I want to rotate something about it's center say in the Y direction.

Share this post


Link to post
Share on other sites
Advertisement
Not sure if I'm understanding you correctly, but rotation and translation are separate things. The Y axis - any axis - is a normalized vector, which represents direction only, not position. So whether your object is at 0, 0, 0 or 25, 48, 132, the Y axis will still be 0, 1, 0.

You can combine rotation and translation into a 4x4 matrix, but it can also be done separately. If done separately, the order in which you perform the operations will determine the results. In OpenGL, operations occur in the opposite order that they are declared. I don't know how it works in DX.

So in short, try rotating your object around the Y axis, and then translating it. If that doesn't work, try translating it and then rotating it.

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!