PDA

View Full Version : OpenGL 3.3 left/right handed system



Etay Meiri
12-09-2010, 01:18 PM
Hi,

In older versions of OpenGL it was a common knowledge that this is a right handed system so only stuff with negative Z (post-transform) is visible. In OpenGL 3.3 and without the fixed function pipeline my question is - does a default system really exists?
I've just played around with my matrices and easily reversed the system by making one change in the projection matrix, changing the Z range from negative to positive and specifying a positive Z for the world position. I did a quick scan thru the spec and could not find a reference to a default system.
Is there an advantage to sticking to the old definition in terms of the way other parts of the spec are effected?

Thanks,

Etay Meiri

aqnuep
12-10-2010, 02:00 AM
You understand it correctly so that there is no rule to use a right or left handed coordinate system anymore.


Is there an advantage to sticking to the old definition in terms of the way other parts of the spec are effected?

Yes, convenience and backwards compatibility but the choice is yours.

_arts_
12-10-2010, 03:33 AM
Wasn't it already possible to reverse the axis by hand before GL 3 ?

And, isn't it "bad" to change the default axis systems to whatever could fit our mind ? I mean ortho axis system is such that any axis makes a 90 angle between them, so reversing an axis breaks this rule, and then makes coordinates more bad to guess, and rotations more hard to understand (I mean by mind). So I wonder what is the real positive thing in doing so ?

aqnuep
12-10-2010, 04:26 AM
Wasn't it already possible to reverse the axis by hand before GL 3 ?

Actually that is also true, but I think he meant that the GL was supposing a right handed system and explained the transformations and default behavior accordingly.

Etay Meiri
12-10-2010, 06:27 AM
Correct. You can refer to a system as either left or right handed when you don't have direct control of the transformation matrices (i.e. fixed function pipeline). When you do have control, you need to decide one way or the other and stick to it. Backward compatibility is not always relevant. Depends on the circumstances.
My only concern was that I may be missing something and further down the way with more complex programs I will need to change stuff that assume a right handed system.

V-man
12-11-2010, 03:37 PM
Correct. You can refer to a system as either left or right handed when you don't have direct control of the transformation matrices (i.e. fixed function pipeline).

You do have control of the transformation matrices in fixed function pipeline. You can make a identical transformation matrix (projection and modelview) to Direct3D. The main difference boils down to what is front face and what is back face. This difference is still present today.