Jump to content
  • Advertisement
Sign in to follow this  
matrix2681

Point Rotation Result

This topic is 4507 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 need a way to take a point and find out where it would be after a rotation about an axis. Anybody know any resources? Thanks, Michael

Share this post


Link to post
Share on other sites
Advertisement
An equation to rotate a vector v about a unit-length axis n by an angle t is:
v' = cos(t)(v-(v.n)n)+sin(t)(nXv)+(v.n)n
The derivation involves separating v into components perpendicular and parallel to n, rotating the perpendicular portion, and then re-composing.

The equation is more commonly expressed in matrix form. Googling for 'axis angle matrix' will mostly likely turn up the algorithm for constructing this matrix (just be aware of row vs. column vector issues).

The equivalent quaternion equation is:
v' = q*v*q~
Where v and v' are quaternions whose real part is arbitrary (usually 0) and whose imaginary part corresponds to the vector in question. Note that the above is for quaternions using 'standard' multiplication order; if you were using, say, the DirectX quaternion class, the order of multiplication would be reversed.

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!