glut.glutSolidTorus(gl, 0.25f, 0.5f, 40, 20);
glut.glutSolidTeapot(gl, 0.8f);
    public void init(GLDrawable drawable) {      // init() might get called more than once if the GLCanvas is      // added and removed, but we only want to install the DebugGL      // pipeline once      //      if (!(drawable.getGL() instanceof DebugGL)) {      //        drawable.setGL(new DebugGL(drawable.getGL()));      //      }      GL gl = drawable.getGL();      GLU glu = drawable.getGLU();      glut = new GLUT();      try {        checkExtension(gl, "GL_ARB_multitexture");        checkExtension(gl, "GL_ARB_depth_texture");        checkExtension(gl, "GL_ARB_shadow");        checkExtension(gl, "GL_ARB_pbuffer");        checkExtension(gl, "GL_ARB_pixel_format");      } catch (GLException e) {	e.printStackTrace();	throw(e);      }            gl.glClearColor(.5f, .5f, .5f, .5f);      decal = genTexture(gl);      gl.glBindTexture(GL.GL_TEXTURE_2D, decal);      BufferedImage img = readPNGImage("demos/data/images/decal_image.png");      makeRGBTexture(gl, glu, img, GL.GL_TEXTURE_2D, true);      gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);      gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);      light_image = genTexture(gl);      gl.glBindTexture(GL.GL_TEXTURE_2D, light_image);      img = readPNGImage("demos/data/images/nvlogo_spot.png");      makeRGBTexture(gl, glu, img, GL.GL_TEXTURE_2D, true);      gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);      gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);      gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);      gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);      quad = gl.glGenLists(1);      gl.glNewList(quad, GL.GL_COMPILE);      gl.glPushMatrix();      gl.glRotatef(-90, 1, 0, 0);      gl.glScalef(4,4,4);      gl.glBegin(GL.GL_QUADS);      gl.glNormal3f(0, 0, 1);      gl.glVertex2f(-1, -1);      gl.glVertex2f(-1,  1);      gl.glVertex2f( 1,  1);      gl.glVertex2f( 1, -1);      gl.glEnd();      gl.glPopMatrix();      gl.glEndList();      wirecube = gl.glGenLists(1);      gl.glNewList(wirecube, GL.GL_COMPILE);      glut.glutWireCube(gl, 2);      gl.glEndList();      geometry = gl.glGenLists(1);      gl.glNewList(geometry, GL.GL_COMPILE);      gl.glPushMatrix();      //      gl.glTranslatef(0, .4f, 0);      // FIXME      //      glutSolidTeapot(.5f);      glut.glutSolidTorus(gl, 0.25f, 0.5f, 40, 20);      gl.glPopMatrix();      gl.glEndList();      gl.glEnable(GL.GL_LIGHT0);      gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, light_ambient);      gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, light_intensity);      gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, light_intensity);      gl.glEnable(GL.GL_DEPTH_TEST);      // init pbuffer      GLCapabilities caps = new GLCapabilities();      caps.setDoubleBuffered(false);      pbuffer = drawable.createOffscreenDrawable(caps, TEX_SIZE, TEX_SIZE);      pbuffer.addGLEventListener(new PbufferListener());      // Register the window with the ManipManager      ManipManager manager = ManipManager.getManipManager();      manager.registerWindow(drawable);      object = new HandleBoxManip();      object.setTranslation(new Vec3f(0, 0.7f, 1.8f));      object.setGeometryScale(new Vec3f(0.7f, 0.7f, 0.7f));      manager.showManipInWindow(object, drawable);      spotlight = new HandleBoxManip();      spotlight.setScale(new Vec3f(0.5f, 0.5f, 0.5f));      spotlight.setTranslation(new Vec3f(-0.25f, 2.35f, 5.0f));      spotlight.setRotation(new Rotf(Vec3f.X_AXIS, (float) Math.toRadians(-30.0f)));      manager.showManipInWindow(spotlight, drawable);      viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());      viewer.attach(drawable, new BSphereProvider() {	  public BSphere getBoundingSphere() {	    return new BSphere(object.getTranslation(), 2.0f);	  }	});      viewer.setOrientation(new Rotf(Vec3f.Y_AXIS, (float) Math.toRadians(45.0f)).times                            (new Rotf(Vec3f.X_AXIS, (float) Math.toRadians(-15.0f))));      viewer.setVertFOV((float) Math.toRadians(lightshaper_fovy / 2.0f));      viewer.setZNear(zNear);      viewer.setZFar(zFar);      float bias = 1/((float) Math.pow(2.0,16.0)-1);      tweaks.add(new Tweak("r coordinate scale",    0.5f, bias));      tweaks.add(new Tweak("r coordinate bias",     0.5f, bias));      tweaks.add(new Tweak("polygon offset scale",  2.5f, 0.5f));      tweaks.add(new Tweak("polygon offset bias",  10.0f, 1.0f));      drawable.addKeyListener(new KeyAdapter() {          public void keyPressed(KeyEvent e) {            dispatchKey(e.getKeyChar());            canvas.repaint();          }        });    }