Examples of glMatrixMode()


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

  @Override
  public void display(GLAutoDrawable gla) {
    long t0 = System.currentTimeMillis();
    GL gl = gla.getGL();
    gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_ACCUM_BUFFER_BIT|GL.GL_STENCIL_BUFFER_BIT);
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    _glu.gluPerspective(_viewPort.getFOV(),_viewPort.getAspect(),_viewPort.getMinZ(),_viewPort.getMaxZ());
    _glu.gluLookAt( _viewPort.getViewWorldX(), _viewPort.getViewWorldY(),  -_viewPort.getZ(),
            _viewPort.getViewWorldX(), _viewPort.getViewWorldY()0,
             0, -10);
View Full Code Here

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

    // Clear buffer, etc.
    GL gl = drawable.getGL();
    gl.glClearColor(1.0f, 1.0f,1.0f, 1.0f);
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
    gl.glMatrixMode(GL.GL_MODELVIEW);
   
    gl.glLoadIdentity();
   
    // Set camera transform
    glu.gluLookAt(cameraFrom.x, cameraFrom.y, cameraFrom.z,
View Full Code Here

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

  @Override
  public void reshape(GLAutoDrawable drawable ,int x,int y, int w, int h) {
    // Setup wide screen view port
    GL gl = drawable.getGL();
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glFrustum (-1.77777*zoom, 1.777777*zoom, -1.0*zoom, 1.0*zoom, 4.0, 100.0);  
    this.height = h; this.width = w;
    this.drawHeight = (int)((double)width/1.77777);
    gl.glViewport (0, (int)((height-drawHeight)/2.0), (int)width, (int)drawHeight);
View Full Code Here

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

    public void display(GLAutoDrawable glDrawable) {
        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();
View Full Code Here

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

        // 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

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

        // Restore enabled state
        gl.glPopAttrib();

        // Restore old matrices
        gl.glPopMatrix();
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glPopMatrix();
    }

    public void displayChanged(GLAutoDrawable glDrawable, boolean b, boolean b1) {
    }
View Full Code Here

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

       
            height = 1;
        }
        final float h = (float) width / (float) height;
        gl.glViewport(0, 0, width, height);
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1.0, 20.0);
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();
    }
View Full Code Here

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

        final float h = (float) width / (float) height;
        gl.glViewport(0, 0, width, height);
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1.0, 20.0);
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();
    }

    public void display(GLAutoDrawable drawable) {
        GL gl = drawable.getGL();
View Full Code Here

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

        if (height <= 0) // avoid a divide by zero error!
            height = 1;
        final float h = (float) width / (float) height;
        gl.glViewport(0, 0, width, height);
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1f, 100.0);
       
        //gl.glOrtho(-100.0f, 100.0f, -100.0f, 100.0f, -500.0f, 500.0f);     
        //gl.glScalef(20.0f, 20.0f, 20.0f);
View Full Code Here

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

        //gl.glScalef(20.0f, 20.0f, 20.0f);
         

       
       
        gl.glMatrixMode(GL.GL_MODELVIEW);      
        gl.glLoadIdentity();   
     }


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.