`
daojin
  • 浏览: 678034 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

OpenGL实践系列之开篇: 坐标系

 
阅读更多
OpenGL再次加强之OpenGL坐标系

OpenGL整体都是如下的坐标理念,横轴向右,纵轴向上,Z轴朝外。

1. ViewPort坐标
左下角为x,y

x, y
Specify the lower left corner of the viewport rectangle, in pixels. The initial value is (0,0).
width, height
Specify the width and height of the viewport. When a GL context is first attached to a window, width and height are set to the dimensions of that window.
2. ND坐标
范围为[-1. 1]的坐标点。中心为0,0

3. 纹理左下角为0,0。由于大部分的图像系统android 和windows都是以左上角为原点。因此处理纹理坐标的时候,要特别注意。对OpenGL来讲,纹理本身是一个数组的话,数组的第一个元素一定是在左下角的。
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics