Jump to content
  • Advertisement
Sign in to follow this  
kslam

Rotation question

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

If I want to make an object rotate its self, such as box. I don't want the object rotate parrelle with Y axis, X axis or Z axis. I want it rotate parrelle with custom axis, such as (5,6,7)----(10,12,14) axis.It is possible to rotate like this ?

Share this post


Link to post
Share on other sites
Advertisement
The conceptually easy way to do it is:

Step one: rotate the object so that an axis (for example the Y axis) aligns with your new axis.
Step two: perform the rotation about the newly aligned axis (y in this case).
Step three: Undo step one by rotating by the inverse of the matrix in step 1.

You can concatenate this to one matrix; just remember the transforms are applied right to left, so its M3*M2*M1.

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!