Global.treelock.writeLock().unlock();
}
}
public void display(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
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;
float farplane = 20.f;
if (nearplane<1.5) farplane = 10;
// if (nav.viewer.length()<1.1) farplane = 0.5;
if (nav.viewer.length()<1.1) farplane = 1.5f;
glu.gluPerspective(45.0f,aspect,nearplane,farplane);
// gl.gluPerspective(45.0f,aspect,0.01f,10.0f);
Point3D viewpoint = nav.getDirection().add(nav.viewer);
glu.gluLookAt(nav.viewer.x, nav.viewer.y, nav.viewer.z, viewpoint.x, viewpoint.y, viewpoint.z, nav.getUp().x, nav.getUp().y, nav.getUp().z);
// gl.glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 );
gl.glEnable(GL.GL_DEPTH_TEST);
render(gl);
gl.glFlush();
// swapBuffers();
/** If the form wants to, it can render it into a movie */
frameFinished();