GLU port

I wanted to thank the LWJGL team in general and Erik Duijs in particular for porting the GLU quadric and projection routines to Java. LWJGL’s license appears to be compatible with JOGL’s and to address the GLU-related crashes we’ve seen in JOGL I’ve just brought those changes in to the JOGL source base (with appropriate attribution).

I also wanted to see if people were still interested in collaborating on porting the GLU NURBS library to Java. There was an attempt started a few months ago by Pepijn Van Eeckhoudt but unfortunately this work was lost. I have a small porttion done at this point (about 2,000 lines out of 40,000 total). If any of you would be interested in helping port this library, please post. I can check in the sources to the JOGL source tree. I don’t care whether the bulk of the work gets done in the JOGL or LWJGL source trees. Bringing it in to the other project is straightforward (as I found while bringing in the LWJGL GLU routines to JOGL).

The mipmap routines would be another possible area of collaboration. LWJGL has a port of gluBuild2DMipmaps, but it uses different algorithms than the original GLU library.

posted the message to the LWJGL boards too:
http://puppygames.net/forums/viewtopic.php?p=5746#5746

I would like to refactor GLU out of LWJGL perhaps and start a brand new project in its own namespace which implements the non-GL tied aspects of GLU as an SPI style interface (ie. all the algorithms etc should be moved into this new project, and then the LWJGL/JOGL implementations can just call into it before calling their own GL commands, where necessary). What say you?

Cas :slight_smile:

This sounds fine. The only thing I’d be worried about is that GL calls are made all over the place in certain pieces of the GLU code. We could bridge this (as you’re probably suggesting) by having an adapter that has methods on it corresponding to only the GL calls made by GLU.

jglu.dev.java.net? Do you want to propose it?

Could we start joint work on the NURBS port before this project is approved? That will save some time. GKW here on the forums is already making good progress porting the mipmapping code.

Incidentally, I fixed a typo in the sphere drawing code pointed out by one of the users on the JOGL forum.


***************
*** 869,875 ****
      dtheta = 2.0f * PI / slices;
  
      if (drawStyle == GLU.GLU_FILL) {
!       if (textureFlag) {
          // draw +Z end as a triangle fan
          gl.glBegin(GL.GL_TRIANGLE_FAN);
          gl.glNormal3f(0.0f, 0.0f, 1.0f);
--- 869,875 ----
      dtheta = 2.0f * PI / slices;
  
      if (drawStyle == GLU.GLU_FILL) {
!       if (!textureFlag) {
          // draw +Z end as a triangle fan
          gl.glBegin(GL.GL_TRIANGLE_FAN);
          gl.glNormal3f(0.0f, 0.0f, 1.0f);

thx - comitted