public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { GL2 gl = drawable.getGL().getGL2(); // gl.glViewport(0, 0, w, h); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); if (w <= (h * 3)) gl.glOrtho( -6.0, 6.0, -2.0 * ((float) h * 3) / (float) w, 2.0 * ((float) h * 3) / (float) w, 0.0, 10.0); else gl.glOrtho( -6.0 * (float) w / ((float) h * 3), // 6.0 * (float) w / ((float) h * 3), -2.0, 2.0, 0.0, 10.0); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glLoadIdentity(); }
public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { GL2 gl = drawable.getGL().getGL2(); // gl.glViewport(0, 0, w, h); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluOrtho2D(0.0, (double) w, 0.0, (double) h); }
@Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { final GL2 gl = drawable.getGL().getGL2(); if (height <= 0) height = 1; final float h = (float) width / (float) height; gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(FOV, h, 1.0, 4000.0); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glLoadIdentity(); }
public void bind() { gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]); gl.glDrawBuffers(count, drawBuffers, 0); gl.glViewport(0, 0, width, height); }
@Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL2 gl2 = drawable.getGL().getGL2(); gl2.glViewport(0, 0, width, height); }