OpenGL再次加强之OpenGL坐标系
OpenGL整体都是如下的坐标理念,横轴向右,纵轴向上,Z轴朝外。
1.ViewPort坐标
左下角为x,y
x,y
Specifythelowerleftcorneroftheviewportrectangle,inpixels.Theinitialvalueis(0,0).
width,height
Specifythewidthandheightoftheviewport.WhenaGLcontextisfirstattachedtoawindow,widthandheightaresettothedimensionsofthatwindow.
2.ND坐标
范围为[-1.1]的坐标点。中心为0,0
3.纹理左下角为0,0。由于大部分的图像系统android和windows都是以左上角为原点。因此处理纹理坐标的时候,要特别注意。对OpenGL来讲,纹理本身是一个数组的话,数组的第一个元素一定是在左下角的。