Package javax.media.opengl

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


    System.err.println("GL_RENDERER: " + gl.glGetString(GL2.GL_RENDERER));
    System.err.println("GL_VERSION: " + gl.glGetString(GL2.GL_VERSION));
    gl.glLoadIdentity();
    gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glTranslatef(0.0f, 0.0f, -40.0f);
  }

  public void dispose(GLAutoDrawable drawable) {
    System.out.println("Gears.dispose: "+drawable);
View Full Code Here


    public void display(GLAutoDrawable gLDrawable)
    {
        final GL2 gl = gLDrawable.getGL().getGL2();
        gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
        gl.glLoadIdentity();
        gl.glTranslatef(-1.5f, 0.0f, -10.0f);
        gl.glColor3f(0f, 255f, 255f);
        gl.glRotated(20,20,0,20);
        gl.glBegin(GL2.GL_TRIANGLES);
        gl.glVertex3f(0.0f, 1.0f, 0.0f);
View Full Code Here

        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

        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();
    }


    public void dispose(GLAutoDrawable arg0)
    {
View Full Code Here

  }
 
  float[] applyMArray = new float[16];
  private void applyTransform(Matrix4f matrix) {
    GL2 gl = drawable.getGL().getGL2();
    gl.glLoadIdentity();
    convert(matrix, applyMArray);
    gl.glMultMatrixf(applyMArray, 0);
  }
  private void convert(Matrix4f m, float[] d) {
    d[0] = m.m00;
View Full Code Here

        System.out.println("Disabling snapshot");

        GL2 gl = pbuffer.getGL().getGL2();
        gl.glMatrixMode(GL2.GL_MODELVIEW);
        gl.glLoadIdentity();

        //Init
        drawable.initConfig(gl);
        vizConfig.setDisableLOD(true);
        engine.initScreenshot(gl, GLAbstractListener.glu);
View Full Code Here

            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);
            gl.glGetFloatv(GL2.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer


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

            glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
            gl.glGetFloatv(GL2.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer


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

            reshape3DScene(drawable.getGL().getGL2());

            if (DEBUG) {
                DEBUG = false;
View Full Code Here

  @Override
  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(GLMatrixFunc.GL_PROJECTION);
    gl.glLoadIdentity();
    this.overlay.updateSize(w, h);
    this.glu.gluPerspective(60.0f, w * 1.0f / h, .01f, 1000.0f); // FOV,
    // AspectRatio,
    // NearClip,
    // FarClip
View Full Code Here

  @Override
  public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
    GL2 gl2 = arg0.getGL().getGL2();

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

    // coordinate system origin at lower left with width and height same as the window
    GLU glu = new GLU();
    glu.gluOrtho2D(0.0f, getWidth(), 0.0f, getHeight());
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.