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.
Coordinates are usually right-handed. For right-handed coordinates the right thumb points along the z axis in the positive direction and the curl of the fingers represents a motion from the first or x axis to the second or y axis. When viewed from the top or z axis the system is counter-clockwise.
In this case, right-handedness is defined as any positive axis (x, y, or z) pointing toward the viewer. Left-handedness is defined as any positive axis (x, y, or z) pointing away from the viewer.
Example: Rotate the point (5, 8) about the origin 270° clockwise. The rule for rotating an object 270° clockwise about the origin is to take the opposite value of the coordinate and then switch it with the coordinate. The opposite of 5 is -5 and, switching the coordinates, we obtain our answer: (8, -5).
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:
Sometimes, a picture paints a thousand words...
Actually, there are several valid right-hand configurations, so pick one and stick with it:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With