tesselator + combine

I’m throwing some pretty crazy shapes at the tesselator and it does the job 99% of time. I just realized that my shapes were failing due to a lack of handling the “combine” callback. I wrote a callback and I figured in order to return a new vertex I had to modify the fourth parameter, we’ll call that parameter “out”. I’ve been trying to set out[0] to a custom vertex object, but always run into array store exceptions. If I ignore the combine callback, I’ll get error callback with a value of “must have combine callback”.

What am I doing wrong here?

It looks like the outData parameter for the combine callback is allocated as a 2D array of doubles. See src/net/java/games/jogl/impl/tesselator/Sweep.java in the JOGL workspace. I haven’t used the tesselator extensively and am not sure how this corresponds to the analogous C signatures. If you think there’s a bug in either the specification of the data type for outData or how it’s allocated in the Java port of the tesselator then please file a bug with the JOGL Issue Tracker linked off the JOGL home page.

doh! I reall should have checked the original source to understand what type the outData was expecting. The Jogl javadoc should probably mention what the type of outData is. Taking it a step further, I don’t feel like double[][] is the right type for out data any. It just means that a subsequent call to the vertex callback is going to supple a double[] as paramter when all of my other calls supply a custom object. I know how to check and see if the vexter callback is being supplied with either type of object. A trivial fix on my side, but I’m wondering what is correct for the jogl side?

It does look like this was just a bug in the Java port of the GLU tesselator routines. I just checked in a fix which allocates outData as a 1-length Object array; if you can, please check out the CVS sources, build them, and try your program again. If not, this fix will be present in the next JOGL beta.