I'm having some trouble understanding the "correct" direction to rotate in 3D for a positive angle on each axis. Some of this may come down to convention (?), and if so, I suppose I'm asking for opinions rather than facts.

In my game world, Y=up, Z=forward, and X=right. I'm in the middle of writing some matrix-rotation functions that use sin()/cos() to spin their vectors around each specific axis (such as RotateX(float angle), etc). I'm currently relying on DirectX (using D3DXQuaternionRotationAxis() on an ID-quaternion with specific hardcoded axes, then examining the result) to determine which way to spin a positive angle around each axis. This is what I've extracted from that:

Positive rotation of 90 degrees on each axis: (rotation concept for a car in parenthesis, for mental image)

X-axis: changes Z+ to Y- (car goes down hill, forward)

Y-axis: changes Z+ to X+ (car goes around a turn to the right)

Z-axis: changes X+ to Y- (car rolls, facing driver-side toward the ground)

For some reason, the X and Y axis rotations "feel right" to me, but the Z axis feels backwards. The Y rotation feels clockwise (?) while Z feels counter-clockwise (I guess the concept of clockwise is a 2D notion?). Is it just me? Is there a reason this axis rotates in that specific direction? Is this the logical way math plays out when working with quaternions, or was it a decision made by Microsoft? Judging by my own quaternion math (which is still in its infancy), I would say it just works out that way, but I can't really rely on it being accurate at the moment.

I'm asking this question in the Graphics forum because that's what my math library will be used for. The proper math angles don't concern me as much as what will work best when rotating 3D objects. In the end, these may both be the same, but I'm not in the place to know yet.

Thanks a bunch for any advice.

**Edited by Stephany, Yesterday, 02:03 PM.**