开发者

OpenGL: Convention for which axis is "up"?

I'm new to Op开发者_如何学GoenGL. It appears that I can make whatever axis be "up" that I want. However, what is idiomatic/conventional?


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.


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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜