Sign in to follow this  
greentea8202

quaternion and rotation matrix

Recommended Posts

greentea8202    122
I was reading some codes and somehow it confused me.. Some codes set quaternion as q = (axis.x, axis.y, axis.z, cos(t/2)) and Some other ones set as q = (cos(t/2), sin(t/2)*axis). I know that definition of quaternion has 2nd form I just listed, that w is cos of half angle and x, y, z should be multiplied the sin of half angle... But why would the first form work?? Also I saw making quaternion into a matrix, matrix can be 2 forms by changing the sign of the calculation that are not on the identity elements. That is m =| a x x 0 | | x b x 0 | | x x c 0 | | 0 0 0 1 | where x's are have 2 different ways of calculation. (either 2xy+2wz or 2xy-2wz). Why is this so?? please help me! thx~~

Share this post


Link to post
Share on other sites
jvsquare    184
Sounds like the first form is wrong, unless they're assuming that the axis is already pre-scaled. Even if you normalized it, it still wouldn't give you the right result. It could be that they're doing something unusual with it; I'd have to see the code.

There are two different forms of rotation matrix because you can either have a rotation matrix for column vectors or a rotation matrix for row vectors. They're transposes of each other.

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