Thanks for the help guys.
I have been trying to implement the Tesselation but keep running into an error when I execute:
"Java.lang.ArrayOutOfBoundException: 6 " followed by “Tessellation Error: Out of Memory”. I have no idea what could be causing this. Samples of my code follow:
// Shape is a Class that contains Two Arrays:
// 1 that has X, Y, Z Coordinates of Polygons that are to be "holes" and
// 2. X, Y, Z Coordinates of Polygons that are Solid
// Get the Vector of Shape Objects
Vector vecHoles = this.dm.getFinalFaceHoleObjects();
for (int i = 0; i < vecHoles.size(); i++) {
GLU glu = new GLU();
tessellCallBack tessCallback = new tessellCallBack(gl, glu);
GLUtessellator tobj = glu.gluNewTess();
glu.gluTessCallback(tobj, GLU.GLU_TESS_VERTEX, tessCallback);
glu.gluTessCallback(tobj, GLU.GLU_TESS_BEGIN, tessCallback);
glu.gluTessCallback(tobj, GLU.GLU_TESS_END, tessCallback);
glu.gluTessCallback(tobj, GLU.GLU_TESS_ERROR, tessCallback);
// Get the double[][] for "holes" and "non-holes" respectively
double[][] holePts = sp.getArrayHolePts();
double[][] wholePts = sp.getArrayPts();
glu.gluTessBeginPolygon(tobj, null);
glu.gluTessBeginContour(tobj);
for (int j = 0; j < wholePts.length; j++) {
glu.gluTessVertex(tobj, wholePts[j], 0, wholePts[j]);
}// End of FOR-LOOP
glu.gluTessEndContour(tobj);
glu.gluTessEndPolygon(tobj);
glu.gluDeleteTess(tobj);
...
}// End of OUTER FOR-LOOP
// Here I implement the GLUtessellatorCallbackInterface --> Only showing methods I implemented
class tessellCallBack implements GLUtessellatorCallback {
private GL gl;
private GLU glu;
public tessellCallBack(GL gl, GLU glu) {
this.gl = gl;
this.glu = glu;
}
public void begin(int type) {
gl.glBegin(type);
}
public void end() {
gl.glEnd();
}
public void vertex(Object vertexData) {
double[] pointer;
if (vertexData instanceof double[]) {
pointer = (double[])vertexData;
gl.glVertex3dv(pointer, 0);
}
}
public void error(int errnum) {
String estring;
estring = glu.gluErrorString(errnum);
System.err.println("Tessellation Error: " + estring);
System.exit(0);
}// End of error(int)
}// End of tessellCallBack
I am hoping it is something obvious but I just can’t see it at this point. I hope that one of you JOGL Gurus have an idea.
Once again, Thanks.