Sign in to follow this  
Gumgo

Rotate point around line

Recommended Posts

haegarr    7372
In addition, you need to make a correction step, since the axis of the axis/angle rotation is defined to pass through [0 0 0]. Hence, choose any point on the line, e.g. one of the both directly given points, as temporary origin. If p1 and p2 are the 2 given points, then a transformation like
T(p1) * R(p2-p1,alpha) * T(-p1)
is suitable, where T denotes a translation matrix and R the rotation matrix as suggested by Mike nl. (Notice please that I've used column vectors (e.g. OpenGL) in the formula above; reverse the order if you use row vectors (e.g. D3D) instead.)

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