Examples of glViewport()


Examples of javax.media.opengl.GL.glViewport()

    final GLU glu = new GLU();

    if(height <= 0)
      height = 1;

    gl.glViewport(0, 0, width, height);

    gl.glMatrixMode(GL.GL_PROJECTION);                //Select the Projectionmatrix
    gl.glLoadIdentity();                    //Reset the current matrix
    glu.gluPerspective(45.0f, width / height, 0.1f, 1000.0f)//set the Viewing Volume
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

      glu.gluOrtho2D(0.0f, width, 0.0, height);
     
      glMatrixMode.invoke(gl, GL2.GL_MODELVIEW);
      glLoadIdentity.invoke(gl);
     
      gl.glViewport(0, 0, width, height);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

  }

  @Override
  public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
    GL gl = drawable.getGL();
    gl.glViewport(x, y, width, height);
    onReshape(drawable, x, y, width, height);
  }
 
  @Override
  public void display(GLAutoDrawable drawable) {
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

    glu.gluOrtho2D(0.0f, getWidth(), 0.0f, getHeight());

    gl2.glMatrixMode(GL2.GL_MODELVIEW);
    gl2.glLoadIdentity();

    gl2.glViewport(0, 0, getWidth(), getHeight());

    controller.updateExtents(arg3 / 2, arg4 / 2);
  }
}
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

    if (height <= 0) { // avoid a divide by zero error!
      height = 1;
    }
    h = (float) width / (float) height;

    gl.glViewport(0, 0, width, height);

    // actualise la camera
    repaint(gl);

    gl.glMatrixMode(GL2.GL_MODELVIEW);
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

    if (height <= 0) { // avoid a divide by zero error!
      height = 1;
    }
    h = (float) width / (float) height;

    gl.glViewport(0, 0, width, height);

    // actualise la camera
    repaint(gl);

    gl.glMatrixMode(GL2.GL_MODELVIEW);
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

        config.setWidth(newWidth);
  config.setHeight(newHeight);

        GL2 gl = drawable.getGL().getGL2();

  gl.glViewport(0, 0, newWidth, newHeight);
  gl.glLoadIdentity();
  gl.glOrtho(-0.5f, newWidth - 0.5f, -0.5f, newHeight - 0.5f, -1.0f, 1.0f);

        julia3d.update(true);
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

        config.setWidth(newWidth);
  config.setHeight(newHeight);

        GL2 gl = drawable.getGL().getGL2();

  gl.glViewport(0, 0, newWidth, newHeight);
  gl.glLoadIdentity();
  gl.glOrtho(-0.5f, newWidth - 0.5f, -0.5f, newHeight - 0.5f, -1.0f, 1.0f);

        julia3d.update(true);
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

            height = 1;
        }

        final float h = (float) width / (float) height;

        gl.glViewport(0, 0, width, height);
        gl.glMatrixMode(GL2.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1.0, 20.0);
        gl.glMatrixMode(GL2.GL_MODELVIEW);
        gl.glLoadIdentity();
View Full Code Here

Examples of javax.media.opengl.GL2.glViewport()

            viewportX = ((width - viewportW) / 2);
            viewportY = ((height - viewportH) / 2);

            GL2 gl = drawable.getGL().getGL2();

            gl.glViewport(viewportX, viewportY, viewportW, viewportH);
            gl.glGetIntegerv(GL2.GL_VIEWPORT, viewport);//Update viewport buffer

            gl.glMatrixMode(GL2.GL_PROJECTION);
            gl.glLoadIdentity();
            glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.