Angle-axis rotations - a quickie beginner question

Started by
3 comments, last by Prospero 21 years, 7 months ago
Hi all, Could some kind soul help a beginner out... I've just implemented a (very) rough version of some code for transforming 3D vectors via the Angle-axis method (as opposed to the Euler or Quarternions methods - I'll get to Quarternions one day!). In my application, I start off with the angle values for yaw, pitch and roll - so I'm assuming my method should look like this (for a yaw / pitch / roll rotation order): 1) Define three unit vectors along the world axes. 2) Leave the unit vector along the yaw axis alone. 3) Rotate the unit vector along the pitch axis by the yaw angle. 4) Rotate the unit vector along the roll axis by the yaw angle, and then the pitch angle. 5) Now that I have the angles and the axes, I build the three rotation matrices. 6) Concentate the matrices into one transform matrix. 7) Apply this matrix to all the relevant 3D vectors. 8) Loop back to the start. So, to my question: In steps 3) and 4) above, I rotate these unit vectors using the standard (right-handed, in my case) 3x3 Euler rotation matrices. But I thought the whole point of the Angle-axis method was to avoid the Euler method! I've probably missed something very obvious... but could you tell me what it is? Is there a simpler / better / different way to actually build the Angle/axis information in the first place? Remember, I must start with the angles in my application. Many thanks, Anthony Webber [edited by - Prospero on September 11, 2002 1:48:17 PM] [edited by - Prospero on September 11, 2002 1:51:10 PM]
Advertisement
You got the idea wrong

The main idea behind the axis angle method is to totally avoid any use of Euler angles, thus avoiding the gimbal lock problem.

quote:
Is there a simpler / better / different way to actually build the Angle/axis information in the first place? Remember, I must start with the angles in my application.

In that case, you can't use the axis-angle method. You could of course transform Euler angles to axis-angle representation, but this would lose the whole point of it (avoiding gimbal lock). You could just build up the matrix directly from roll, pitch and yaw, the result would be the same.

If you want to make use of the axis-angle method, you'll have to drop Euler angles completely: you directly specify the rotation itself using an axis and an angle (no roll, pitch or yaw anymore).

This representation is then converted to a 3x3 rotation matrix by the use of a quaternion. That's the only way to do it (without converting to Euler angles at any point in the computation), you won't be able to avoid quaternions. But the axis-angle -> matrix conversion equation is pretty simple, you could just copy and paste it.

/ Yann

[edited by - Yann L on September 12, 2002 6:24:16 PM]
Yann,

Many thanks for the explanation. OK, so the only way I can use angle-axis (or quarternion) rotations is if I work from angle-axis (or quarternion) in the first place. I think I understand.

Clearly then, I need to derive my source orientation data in a different way. Basically the application is pretty simple - I need to calculate the orientation (in whatever form) of 3 non-colinear points (a plane!) in a Cartesian coordinate system (they're actually GPS antennae).

Not sure, but I may be able to form a quarternion directly...

Thanks again,

Anthony Webber



[edited by - Prospero on September 13, 2002 1:07:08 PM]
Yann,

Many thanks for the explanation. OK, so the only way I can use angle-axis (or quarternion) rotations is if I work from angle-axis (or quarternion) in the first place. I think I understand.

Clearly then, I need to derive my source orientation data in a different way. Basically the application is pretty simple - I need to calculate the orientation (in whatever form) of 3 non-colinear points (a plane!) in a Cartesian coordinate system (they're actually GPS antennae).

Not sure, but I may be able to form a quarternion directly...

Thanks again,

Anthony Webber



[edited by - Prospero on September 13, 2002 1:07:36 PM]
Yann,

Many thanks for the explanation. OK, so the only way I can use angle-axis (or quarternion) rotations is if I work from angle-axis (or quarternion) in the first place. I think I understand.

Clearly then, I need to derive my source orientation data in a different way. Basically the application is pretty simple - I need to calculate the orientation (in whatever form) of 3 non-colinear points (a plane!) in a Cartesian coordinate system (they''re actually GPS antennae).

Not sure, but I may be able to form a quarternion directly...

Thanks again,

Anthony Webber

This topic is closed to new replies.

Advertisement