@Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL2 gl = drawable.getGL().getGL2(); // GLU glu = new GLU(); if (height <= 0) { // avoid a divide by zero error! height = 1; } viewport = new Viewport(width, height); // gl.glViewport(0, 0, width, height); // size of drawing area // // gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION); // gl.glLoadIdentity(); // glu.gluPerspective(Viewport.PERSP_VIEW_ANGLE, // viewport.viewportAspectRatio(), // Viewport.PERSP_NEAR_CLIPPING_PLANE_DISTANCE, 1500.0); ViewportUtil.reshapePerspective(viewport, gl); }
/** * Sets camera position and rotation. * * @param glu GLU * @param pCamera */ private void setCamera(GL2 gl, GLU glu, Camera pCamera) { viewport.updateViewport(pCamera); ViewportUtil.lookAt(gl, viewport); }