Package javax.media.opengl

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


    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

    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

        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

        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

            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

            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

  }

  @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,
View Full Code Here

    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

        this.scaleFactor = this.scaleFactorBase * this.zoomMultiplier;
        this.panMultiplierX = VisualizerUtils.getRelativeMovementMultiplier(this.objectMin.x, this.objectMax.x, this.xSize);
        this.panMultiplierY = VisualizerUtils.getRelativeMovementMultiplier(this.objectMin.y, this.objectMax.y, this.ySize);

        // Set the view port (display area) to cover the entire window
        gl.glViewport(0, 0, width, height);
    }

    /**
     * Called back by the animator to perform rendering.
     * GLEventListener method.
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.