示例#1
0
  /** @see OpenGLTab#renderScene() */
  void renderScene() {
    GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    GL.glLoadIdentity();
    GL.glTranslatef(xPos, yPos, zPos);
    GL.glRotatef(rotY, 0.0f, 1.0f, 0.0f);

    GL.glCallList(cubeListIndexBase);

    GL.glPushMatrix();
    GL.glTranslatef(3, 0, -3);
    GL.glCallList(cubeListIndexBase);
    GL.glPopMatrix();

    GL.glPushMatrix();
    GL.glTranslatef(-3, 0, -3);
    GL.glCallList(cubeListIndexBase);
    GL.glPopMatrix();

    GL.glPushMatrix();
    GL.glTranslatef(0, 0, 4);
    GL.glCallList(cubeListIndexBase);
    GL.glPopMatrix();

    rotY += 0.6f;
  }