Advertisement

Applying axis angle to a vector

Started by July 26, 2001 06:34 PM
0 comments, last by David20321 23 years, 6 months ago
Ok I know how to rotate a vector with euler angles using sin and cos but how do I rotate a vector around a given axis like with axis angle... as in what''s the software version of glRotatef(), would I just rotate around like a euler angle x,y and z but where the angle is scaled by the x,y and z coordinates of the axis vector? -David-
The easiest way is to generate a rotation matrix or quaternion from your angle axis information. These are both common uses of angle-axis data, and you can either use an API call (depending on the API) or generate the matrix or quaternion yourself.

There''s not much to choose between the two mathods for a single vector. If you are going to be rotating a lot of points/vectors a matrix is quicker, while a quaternion is quicker to work out and requires less storage.
John BlackburneProgrammer, The Pitbull Syndicate

This topic is closed to new replies.

Advertisement