[NG]: I sure hope I manage to grab Jim's attention... Ummm... better late than never? I hope, anyway...
[NG]: I then effect the desired change upon the angles, and go back to rectangular.
(r*cos(<z),r*sin(<z),r*cos(<x)) I think you probably want something more like
(r*cos(<z)*sin(<x),r*sin(<z)*sin(<x),r*cos(<x))
assuming that <x is the absolute angle with the axis. (As opposed to <z which is evidently the angle between the x axis and the projection into the x-y plane. Which seems like a strange naming convention, but I'm trying to play along. Other refereces will probably use different naming conventions.)
BTW, you win bonus points for using "effect" correctly as a verb.
The link to Ahab's Math Tutorial looks good. Can't comment on the German stuff. (Not without a lot more work which I'm too lazy to do.) You may be wondering: why use matrices here? What's the point? The thing is, usually if you're interested in rotating a single point (x1,y1,z1) to a new coordinate, you're also interested in rotating a set of attached points (x[i],y[i],z[i]). Where "attached" means all the points are part of a single rigid body rotating about the origin. (Or about some other point, if you want to combine transposition and rotation in a single operation, which is certainly possible.) Calculating a sine or cosine in general takes a lot more work than a single multiplication, which in turn takes notably more work than a single addition. By using matrices, you get to generalize the procedure for calculating the results of a given rotation, using only a few sine/cosine calculations as a fixed cost for the rotation, plus about 9 multiplications per point (plus a few additions that no one really cares about). Much more efficient than recalbulating a sine &/or cosine for each point you wish to rotate.
One way to make sure I'm getting a sphere would be to include the third angle, but I bet I don't need to. I'm not sure what you mean by "getting a sphere" here, but in general I think you probably need a third angle to capture all the possibilities here. In general rotation in 3-D needs three angles of some sort. Imagine that you've got a globe (as in, a spherical map of the
Earth) and you want to put it in some arbitrary orientation. If you want to point the North pole of the globe in a particular direction, that requires two angles of some sort (or 1 if your cooridinate axes just happen to be oriented just right with respect to the desired rotation, but that's cheating). Once you've got the north pole pointed in the right direction, it still takes one more angle to cover rotations about the polar axis. There are many different ways to specify the 3 different rotational degrees of freedom you need here (which may be intermingled with the 3 different tranpositional degrees of freedom you may also require) but in general, for a rotation in 3 dimensions you need 3 angles. It doesn't look like Ahab's tutorial gets into the details much for this, but you can problably get what you need googling
"rotation matrix".
Hope that helps...
[ December 29, 2004: Message edited by: Jim Yingst ]