opengl - Libgdx - Custom Created 3d Mesh causes java.nio.BufferOverflowException -
i using libgdx generate 3d mesh in code. right attempting generate flat plane many vertices in middle test things out, received exception in thread "lwjgl application" java.nio.bufferoverflowexception when called mesh.setindices(indices); variable indices short array. i not having trouble if have less 180-150 indices. wasn't able figure out exact number trail , error, exception thrown if have more 180 indices. here code creating mesh: firstly how generate vertices (i don't think problem, ill put them in anyways) *note vertex attributes (vertexattribute.position(), vertexattribute.normal(), vertexattribute.colorunpacked()) private float[] generatevertices(int width, int height) { int index = 0; float vertices[] = new float[width*height*10]; for(int = 0; < width; ++) { for(int j = 0; j < height; j++) { //vertex coordinates vertices[index] = i; vertices[index+1] = 0; vertices[index+