Java - OpenGL设置中心(0,0)坐标的偏移量



我正在用JOGL库做一些事情(被迫),我不知道如何偏移中心零坐标。我想在

方法中将它们偏移到视图的底部

public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)

,但我不能谷歌任何方法转换成任何有意义的偏移浮动坐标的高度。

编辑:

gl.glViewport(0, 0, width, height); 
gl.glMatrixMode(GL_PROJECTION); 
gl.glLoadIdentity(); 
glu.gluPerspective(45.0, width / (float) height, 0.1, 100.0); 
gl.glMatrixMode(GL_MODELVIEW);
gl.glLoadIdentity(); 

使用

解决

glu。

没有意识到偏移量不是相对的

最新更新