views:

454

answers:

3

I'm tired of thinking how the hell my coodinates are working at each case.

I heard that I could flip the Y-axis by this code:

glScalef(1, -1, 1);

But should I? Doesnt this break some other external functions and lighting etc?

+1  A: 

There's no correct yes/no answer to this question. Calling glScalef(1, -1, 1) means using a left-handed instead of a right handed coordinate system, this has historically been the choice of for instance Direct3D and the RenderMan Interface. Some people feel it's more intuitive to have the positive z-axis pointing in to the screen instead of out of it (which is one version of a left handed coordinate system, the y-axis pointing down is another).

If you chose to switch coordinate system, you will have to change some of the standard settings in OpenGL to make it work. For instance you probably want to call glCullFace(GL_FRONT) (or reverse the order of all triangles sent to OpenGL).

Andreas Brinck
thanks, i didnt realise this culling problem too.
+4  A: 

i may say, getting used to opengl defaults is the fastest way of walking out of confusing.

dex
A: 

I could be wrong, but it might turn your models inside-out. You will probably also need to swap your vertex winding order. If you use two-sided polygons, though, then you don't need to worry.

Daniel Yankowsky