Halcyon

12-29-2002, 09:43 PM

Ok i'm a little confused with exactly how rotation matrices work. Say you have a model located at coordinates (0,0,0) or the origin of the world space...when you apply a rotation, the resulting coordinates will still be (0,0,0). If it were not centered at the origin, you'd get the location of the object but now the direction it is facing. Here is what i mean:

This is a rotation of an object located the origin around the z axis ( oh and ? is actually a theta):

[cos ? -sin ? 0 0] [ 0 ] [ 0 ]

[sin ? cos ? 0 0] * [ 0 ] = [ 0 ]

[0 0 1 0] [ 0 ] [ 0 ]

[0 0 0 1] [ 1 ] [ 1 ]

As you can see there is no indication of an actualy rotation. I'm read the book Real-Time Rendering and i'm gleaning this from there (the rotation matrix only). But from all the other transforms in the book it seems like the correct operation to get the resulting transformb X would be to use this formula:

X = Rz(?) * p

Where Rz(?) is the 4x4 rotation matrix in homogeneous coordinates and p is the point in matrix form with homogeneous coordinates.

Thanks for all the help in advance and i hope everyone has a happy new years!!

- Halcyon

P.S. Sorry for the crude matrix diagrams...i didn't know or a better way of doing them!

Edit: Sorry matrices were not aligned right

[This message has been edited by Halcyon (edited 12-29-2002).]

This is a rotation of an object located the origin around the z axis ( oh and ? is actually a theta):

[cos ? -sin ? 0 0] [ 0 ] [ 0 ]

[sin ? cos ? 0 0] * [ 0 ] = [ 0 ]

[0 0 1 0] [ 0 ] [ 0 ]

[0 0 0 1] [ 1 ] [ 1 ]

As you can see there is no indication of an actualy rotation. I'm read the book Real-Time Rendering and i'm gleaning this from there (the rotation matrix only). But from all the other transforms in the book it seems like the correct operation to get the resulting transformb X would be to use this formula:

X = Rz(?) * p

Where Rz(?) is the 4x4 rotation matrix in homogeneous coordinates and p is the point in matrix form with homogeneous coordinates.

Thanks for all the help in advance and i hope everyone has a happy new years!!

- Halcyon

P.S. Sorry for the crude matrix diagrams...i didn't know or a better way of doing them!

Edit: Sorry matrices were not aligned right

[This message has been edited by Halcyon (edited 12-29-2002).]