Package javax.media.opengl

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


        GLContext context = pbuffer.getContext();
        if (context.makeCurrent() == GLContext.CONTEXT_NOT_CURRENT) {
            throw new RuntimeException("Error making pbuffer's context current");
        }
        GL gl = pbuffer.getGL();
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();

        //Init
        drawable.initConfig(gl);
        vizConfig.setDisableLOD(true);
View Full Code Here


            GL gl = drawable.getGL();

            gl.glViewport(viewportX, viewportY, viewportW, viewportH);
            gl.glGetIntegerv(GL.GL_VIEWPORT, viewport);//Update viewport buffer

            gl.glMatrixMode(GL.GL_PROJECTION);
            gl.glLoadIdentity();
            glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
            gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer

View Full Code Here

            gl.glLoadIdentity();
            glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
            gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMatrix);//Update projection buffer


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

            reshape3DScene(drawable.getGL());

            if (DEBUG) {
View Full Code Here

    Global.treelock.writeLock().lock();

    drawFinished = true;
//    if (!rendering.tryLock()) return;

    gl.glMatrixMode( GL.GL_PROJECTION );
    gl.glLoadIdentity();
//    System.out.println("****** ASPECT: "+aspect);

    float nearplane = (float) (nav.viewer.length()-1.3);
    if (nearplane<0.00001f) nearplane=0.00001f;
View Full Code Here

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

    if (height <= 0) // avoid a divide by zero error!
      height = 1;
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glViewport(0, 0, width, height);
    glu.gluPerspective(45.0f, aspect, 1.0, 20.0);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();
View Full Code Here

      height = 1;
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glViewport(0, 0, width, height);
    glu.gluPerspective(45.0f, aspect, 1.0, 20.0);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();

    System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
    System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
    System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
View Full Code Here

                    canvas.setCurrent();
                    context.makeCurrent();
                    GL gl = context.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 glu = new GLU();
                    glu.gluPerspective(vport.getFOV(), vport.getAspect(), vport
                            .getMinZ(), vport.getMaxZ());
                    glu.gluLookAt(vport.getViewWorldX(), vport.getViewWorldY(),
View Full Code Here

  @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

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

  @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

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.