Package javax.media.opengl

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


        GL gl = glDrawable.getGL();

        // Store old matrices
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glPushMatrix();
        gl.glLoadIdentity();
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glPushMatrix();
        gl.glLoadIdentity();

        gl.glViewport(0, 0, glDrawable.getWidth(), glDrawable.getHeight());
View Full Code Here


        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glPushMatrix();
        gl.glLoadIdentity();
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glPushMatrix();
        gl.glLoadIdentity();

        gl.glViewport(0, 0, glDrawable.getWidth(), glDrawable.getHeight());

        // Store enabled state and disable lighting, texture mapping and the depth buffer
        gl.glPushAttrib(GL.GL_ENABLE_BIT);
View Full Code Here

    if(!draw) return;
   
    GL gl = arg0.getGL();
   
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT)//Clear the buffers
    gl.glLoadIdentity();                      //Reset the view
    gl.glTranslatef(0.0f, -2.0f, zOffset);              //Translate the scene backwards   
   
    gl.glPolygonMode(GL.GL_FRONT_AND_BACK, render_mode);
    gl.glCullFace(GL.GL_FRONT);
    gl.glEnable(GL.GL_CULL_FACE);/**/
 
View Full Code Here

      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

    gl.glMatrixMode(GL.GL_MODELVIEW);        //select The Modelview Matrix
    gl.glLoadIdentity();              //set the ModelView matrix to identity
  }
View Full Code Here

    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

    gl.glMatrixMode(GL.GL_MODELVIEW);        //select The Modelview Matrix
    gl.glLoadIdentity();              //set the ModelView matrix to identity
  }

  public void init(GLAutoDrawable glDrawable) {
     renderer = new TextRenderer(
         new Font("SansSerif", Font.BOLD, 10)
View Full Code Here

    GL gl = drawable.getGL();

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

    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glTranslatef(0.0f, 0.0f, -20.0f);
  }
View Full Code Here

    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glTranslatef(0.0f, 0.0f, -20.0f);
  }

  @Override
  public void mouseClicked(MouseEvent mouseevent) {
View Full Code Here

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

  }
 
  private void initGLViewPort() {
    GL gl = delegate.getGL();
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
     
      GLU glu = new GLU();
      float factorX = (float)delegate.getContext().getGLDrawable().getWidth() / (float)image.getWidth();
      float factorY = (float)delegate.getContext().getGLDrawable().getHeight() / (float)image.getHeight();
      glu.gluOrtho2D(0, view.getWidth() * factorX, 0, view.getHeight() * factorY);
 
View Full Code Here

  }

  private void initGLViewPort() {
    GL gl = delegate.getGL();
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
     
      GLU glu = new GLU();
      glu.gluOrtho2D(-view.getWidth() / 2, view.getWidth() / 2, -view.getHeight() / 2, view.getHeight() / 2);
      gl.glMatrixMode(GL.GL_MODELVIEW);
  }
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.