Example #1
0
 public void display(GLAutoDrawable drawable) {
   GL2 gl = drawable.getGL().getGL2();
   //
   gl.glClear(GL.GL_COLOR_BUFFER_BIT);
   gl.glColor3f(1.0f, 1.0f, 1.0f);
   gl.glCallList(startList);
   gl.glCallList(startList + 1);
   gl.glFlush();
 }
Example #2
0
  /*
   * display() draws 5 teapots at different z positions.
   */
  public void display(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();
    //
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    //
    if (fogMode == GL2.GL_EXP2) {
      gl.glFogf(GL2.GL_FOG_START, 1.0f);
      gl.glFogf(GL2.GL_FOG_END, 5.0f);
    }
    gl.glFogi(GL2.GL_FOG_MODE, fogMode);

    renderRedTeapot(gl, -4.0f, -0.5f, -1.0f);
    renderRedTeapot(gl, -2.0f, -0.5f, -2.0f);
    renderRedTeapot(gl, 0.0f, -0.5f, -3.0f);
    renderRedTeapot(gl, 2.0f, -0.5f, -4.0f);
    renderRedTeapot(gl, 4.0f, -0.5f, -5.0f);
    gl.glFlush();
  }
Example #3
0
  @Override
  public void display(GLAutoDrawable drawable) {
    final GL2 gl = drawable.getGL().getGL2();

    gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
    gl.glLoadIdentity();

    applyMovementAndRotation(gl);
    applyLight(gl);
    // enableTransparency(gl);

    for (Shape el : s) {
      el.draw(gl, glu);
    }

    for (ModelShape el : ms) {
      el.draw(gl);
    }

    gl.glFlush();
  }
Example #4
0
  @Override
  public void display(final GLAutoDrawable gLDrawable) {
    final GL2 gl = gLDrawable.getGL().getGL2();

    enableStates(gl, true);

    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    gl.glPushMatrix();
    gl.glRotatef(angleZ, 0.0f, 1.0f, 0.0f);
    gl.glRotatef(45.0f, 0.0f, 0.0f, 1.0f);
    glut.glutSolidTeapot(2.0f);
    gl.glPopMatrix();
    gl.glFlush();
    if (angleZ >= 180.0f) {
      rotDir = -1.0f;
    } else if (angleZ <= 0.0f) {
      rotDir = +1.0f;
    }
    angleZ += rotIncr * rotDir;

    enableStates(gl, false);
  }
  @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();
  }