Sign in to follow this  
kslam

Rotation question

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this