/**
   * This method is called by the GLRenderPanel to redraw the 3D scene. The method traverses the
   * scene using the scene manager and passes each object to the rendering method.
   */
  public void display(GLAutoDrawable drawable) {

    // Get reference to the OpenGL rendering context
    gl = drawable.getGL().getGL3();
    gl.glPolygonMode(GL3.GL_FRONT_AND_BACK, GL3.GL_POINT);

    // Do some processing at the beginning of the frame
    beginFrame();

    // Traverse scene manager and draw everything
    SceneManagerIterator iterator = sceneManager.iterator();
    while (iterator.hasNext()) {
      RenderItem r = iterator.next();
      if (r.getShape() != null
          && r.getShape()
              .checkBoundingSphere(sceneManager.getFrustum(), sceneManager.getCamera(), r.getT())) {
        draw(r);
      }
    }

    // Do some processing at the end of the frame
    endFrame();
  }