@Override
  public void display(GLAutoDrawable pDrawable) {

    if (error) {
      return;
    }

    countFps();

    simpleMoveAnimator.updateState();

    GL2 gl = pDrawable.getGL().getGL2();
    // System.err.println("INIT GL IS: " + gl.getClass().getName());

    GLU glu = new GLU();

    lightRender.draw(gl);

    // _direction_
    // gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION,
    // this.lightPos, 0);

    // // Clear the drawing area
    // gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
    //
    //
    //
    //
    // // Reset the current matrix to the "identity"
    // gl.glLoadIdentity();
    //
    // gl.glMatrixMode(GL2.GL_MODELVIEW);
    // gl.glLoadIdentity();

    // clear color and depth buffers
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    // gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
    gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
    gl.glLoadIdentity();

    setCamera(gl, glu, simpleMoveAnimator);

    gl.glEnable(GL.GL_MULTISAMPLE);

    skyBox.draw(gl, simpleMoveAnimator.getPoint());

    ground.draw(gl, simpleMoveAnimator.getPoint());

    if (modelRender.isDebugging()) {

      axisLabels.draw(gl);

      floor.draw(gl);

      // drawTextInfo(gl, simpleMoveAnimator.info());
    }

    renderJosm.draw(gl, simpleMoveAnimator);

    // selectionDrawUtil.draw(gl, objectSelectionListener,
    // simpleMoveAnimator);

    drawCompass(gl);

    // Flush all drawing operations to the graphics card
    gl.glFlush();
  }
예제 #2
0
파일: Road.java 프로젝트: kendzi/kendzi3d
 @Override
 public void draw(GL2 pGl, Camera pCamera) {
   // FIXME object is not in local coordinates!
   modelRender.render(pGl, model);
 }