if I define the ctrlpoints like “new float[40][41][3]” or “new float[41][40][3]”,or any array larger than [40][40][3],it would draw nothing
does it mean that I could only draw a surface which can not have more than 1600 points?
Could I only draw many surfaces and combine them?but there are gaps between surfaces.
are there any solutions?
float ctrlPoints[][][] = new float[40][40][3];
/*fill ctrlpoints*/
…
FloatBuffer ctrlPointsBuf = FloatBuffer.allocate(ctrlPoints.length * ctrlPoints[0].length * ctrlPoints[0][0].length);
for (int i = 0; i < ctrlPoints.length; i++){
for (int j = 0; j < ctrlPoints[0].length; j++){
for (int k = 0; k < ctrlPoints[0][0].length; k++){
ctrlPointsBuf.put(ctrlPoints[i][j][k]);
}
}
}
ctrlPointsBuf.rewind();
gl.glMap2f(GL.GL_MAP2_VERTEX_3, 0, 1, ctrlPoints[0][0].length, ctrlPoints[0].length, 0, 1, ctrlPoints[0].length * ctrlPoints[0][0].length, ctrlPoints[0].length, ctrlPointsBuf);
gl.glMapGrid2f(smoothness, 0, 1, smoothness, 0, 1);
gl.glPushMatrix();
gl.glEvalMesh2(GL.GL_FILL, 0, smoothness, 0, smoothness);
gl.glPopMatrix();