While trying to understand different coordinate systems I came across this website, which states:
RenderMan uses left-handed coordinate system
and the positive rotation is clockwise
, while OpenGL uses right-handed coordinate system
and the positive rotation is counter-clockwise
.
My question is whether the rotation direction and the coordinate system handedness are just two distinct conventions or this results from maths itself ?
Similarly, I know that the front facing vertices of triangles have to be ordered in counter-clokwise
direction in OpenGL. Does this too relate to coordinate system handedness or it's just another unrelated convention ?
And thirdly, when a picture of random coordinate system with axes labeled as x, y, z
is thrown before me, how do I tell which one is left handed and which one is right handed ?
I know there is a rule with right hand and the middle and the index fingers and the thumb, but everyone seems to use it differently. How should I align my fingers with these axes ?
Sorry for probably mixing a lot of unrelated stuff together, but after reading all kinds of internet sources, things start to blend together in my head.
A fairly common method for either left or right hand:
Again that's:
Given an XYZ coordinate frame, determine positive rotations:
In most cases with which I'm familiar (YMMV), the right-hand rule is the norm. Graphics can be a little screwy in using the left-hand rule sometimes. In the cases with which I'm familiar, which are by no means exhaustive, the left-hand rule is chosen because the programmer/designer wants Z to point in some "natural" direction. Some people don't like the notion of Z pointing into or out of the screen, perhaps.
Once a certain handedness has been chosen, then there are consequences for vector directions. Although I'm not sure this is the right example since I deal with image processing rather than graphics, if a polygon is defined using oriented segments, then the cross product of successive segments will point out of or into the screen. It's important to know which side of the 2D polygon is facing "out" to the viewer, because the polygon may represent some 2D object that has different colors on opposite sides.
More generally speaking, the choice of handedness will determine how cross products are handled. "X cross Y equals Z" is what you're doing when you point your fingers and thumb using your hand.
Try holding out both hands and do this: