我有一个init()
方法,我正在尝试创建一个Perspective
渲染。下面是我到目前为止的代码,但我传递给的数字gluPerspective(fovy, aspect, zNear, zFar)
是错误的。我认为fovy
是视野(60度),并且是纵横比(宽度/高度) ,aspect
但我不知道是什么。zNear
zFar
public void init(GLAutoDrawable gld) {
//We will use the default ViewPort
GL gl = gld.getGL();
glu = new GLU();
gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glu.gluLookAt(
25, 15, 0, // eye
25, 15, 30, // at
0, 1, 0 // up
);
// Set up camera for Orthographic projection:
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(60, 500/300, 0.0, 60.0);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
}