Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm really trying to understand this from a mathematical viewpoint. After all, numbers are numbers, the chirality or handedness depends on how one interprets it.

Say I've three basis vectors x (1, 0, 0), y (0, 1, 0) and z (0, 0, 1). The same basis vectors would be seen differently by the two systems but the numbers remain the same.

enter image description here

When we do a cross product of x and y we'd get z in both systems, again the numbers of the result are the same, it's just the interpretation of the observer.

Then why do I see questions about handedness all the time? Is there a place where a game developer needs to differentiate and work in converting between the two really? Eric Haines in a related article uses the term "right-handed data". What does this really mean, aren't they all numbers? Why would they force a coordinate system on the user? Also do APIs like GL or DX force a system at some point? I've read somewhere that, in OpenGL the camera is always at origin looking at -Z direction, while it's the opposite in DirectX.

It'd be great if someone can list out where this convention really makes a difference and why.

EDIT: I think can explain it more explicitly since many seem to misunderstand the question (sorry, I'm not a native speaker of this tongue). Why do people talk about converting an asset for handedness? Say a triangle with coords (0, 0, 0), (0, 1, 0) and (1, 0, 0) would mean the same in both systems mathematically, where is the handedness here?

share|improve this question
    
Preference really. People in Science just don't like to be limited to one possibility when there are more. If there is another possibility, why not? As long you keep your conventions clear and consistent. Both systems give you the same result. As long the translations are converted correctly. –  Sidar Mar 11 '13 at 12:04
    
@Sidar: Please see the edit added to the question. I think the question was misunderstood, I know that 2 (or more) such conventions exist, and I'm fine by them, I'll keep them consistent in my world/system/code, but why/when would I come across converting, even if I'm consistent? –  legends2k Mar 11 '13 at 13:32
    
Again the person picking either handedness probably just picked it because it seemed more intuitive ( or whatever excuse he had ). You hardly convert between coordinate systems unless you use a combination of frameworks/engines that don't use the same handedness. But you can also assume that most frameworks come with a function to flatten a transformation matrix. Which allows you to easily put one transformation matrix into another coordinate system. Mind you I could be wrong on this. Someone should confirm this ( the reason it's a comment and not an answer ) –  Sidar Mar 11 '13 at 13:39
    
@Sidar: Aah, got it! See the matrix put in an asset depends on the handedness assumed by the designer which forces a handedness on a dev, now that's something tangible and clearly understandable! List of such things is what is wanted in the answer :) –  legends2k Mar 11 '13 at 13:46
    
mindcontrol.org/~hplus/graphics/matrix-layout.html Here is some info on the two. Apparently it's a case of transposing the matrix in this case for OpenGl and DirectX. So it looks like you don't really need to convert much. –  Sidar Mar 11 '13 at 13:54

2 Answers 2

up vote 6 down vote accepted

I'm not sure about OpenGL but DirectX allows you to over write the default left-handedness therefore it wouldn't matter. As you've said, it's "nothing but" a convention, and at least DirectX allows you to work with both. Conventions do not matter by themselves, the only problem is that you need to be consistent with your choice. Mixing two such systems leads to either confusion (if you do make the conversions) or to all sorts of errors if you do not (but why would anyone do that, except for mistakes).

As to what Eric Haines refers to as "right-handed data" I bring this quote from the beginning "OK, so only for viewing you must also know the handedness of the data." and that's exactly where handedness matters, when viewing it. Does a Z-component of 1 make the object closest possible to the screen or furthest? That's why you need to know the handedness of the data, to interpret the data correctly when doing the depth test.

share|improve this answer
2  
OpenGL allows it too. seanmiddleditch.com/journal/2012/08/… –  legends2k Mar 11 '13 at 11:42
    
Yeah, I think I'm starting to see it. So when I've a unit cube where the face opposite to XY plane where z = 1 is the face of a model (as per the artist who prefers LHS), if I just use the points in a RHS viewing system (without taking into account the handedness) then my cube will be behind my camera with its face on the other side, since my camera is pointing to z = -1. If I want to animate a zoom in to the face, on a LHS viewing system I can just increase camera's z, while in RHS, I've to do something round about. –  legends2k Mar 12 '13 at 9:22

It doesn't matter in the sense that the handedness is arbitrary; either way works fine so they just picked one. They only "force" their way on the user in the sense that they had to pick something so they went with that way.

However it does matter in that you need to be consistent about what the numbers mean; it doesn't matter what decision was made initially, but once a decision is made you need to stick with it. For example, when you say:

When we do a cross product of x and y we'd get z in both systems, again the numbers of the result are the same, it's just the interpretation of the observer.

that's not exactly true. The magnitude of the resulting vector is the same, but they point in opposite directions.

share|improve this answer
    
"but they point in opposite directions" - only because you're viewing both the vectors (of 2 different spaces) in a 3rd common reference space do they point in opposite direction; in their space, they point in the same direction, which is +Z direction. –  legends2k Mar 11 '13 at 13:27
    
Well yeah, but... here let me try a different approach. Think about your own body and the word "left". The word "left" refers to one side of your body, but couldn't it just as easily refer to the other side? Why does it matter? The answer to those questions is the answer to this question. –  jhocking Mar 11 '13 at 14:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.