Package javax.media.opengl

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


    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

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

    // TODO Auto-generated method stub
    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

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

  @Override
View Full Code Here

    delegate.init();
  }
 
  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();
View Full Code Here

     
      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);
      gl.glMatrixMode(GL.GL_MODELVIEW);
  }

  public void clear() {
    delegate.clear();
  }
View Full Code Here

    delegate.init();
  }

  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

      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);
  }
 
  public void viewSizeChanged() {
    initGLViewPort();
  }
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.