The controller works on vertices, not on polygons. Your calculation of the array length is based on quads. By default, jPCT uses indexed geometry, i.e. tries to merge vertices that share the same space. The number of polygons (two per quad) that share a vertex isn't the same for each vertex. The vertices at the edges are used by less polygons than the ones inside the plane. In your calculation, you assume that each new quad adds one new vertex to the index, which isn't true for the egdes. That's why the array differs from what you expected it to be. Anyway, i don't see the reason why you are working on the array in the way you do. Why don't you simply walk through it from 0 to length instead of working with x and y?