tags:

views:

47

answers:

2

I'm new to OpenGL. It appears that I can make whatever axis be "up" that I want. However, what is idiomatic/conventional?

+2  A: 

I like +Z to be "up". Makes it easier for me to reason about glVertex(), glNormal(), and glTexCoord() calls.

That said the default/identity GL_MODELVIEW matrix has +Y being "up".

genpfault
Me too, particularly when doing "outdoor" stuff like terrains (+X = East, +Y = North, +Z = Up).
Incredulous Monk
Me too. It also easier for me to implement first-person camera rotation like this. Another argument is that in mathematics you commonly write z = f(x,y), which is connected to the terrain argument.
ybungalobill
+2  A: 

Generally

  • X is horizontal
  • Y is up
  • Z is depth (hence Z-buffer)

you can largely adopt any convention you wish as long as you are internally consistent, but the above is pretty much the standard and using it yourself will make other code easier to understand.

Cruachan
"Which" Y is up?
Neil N
positive Y. Pretty much like drawing a graph in school.
Cruachan