Creating Map Editor

Okay so I am settling down to use my own program to generate and store model data so that I can have world files to bounce off my scene.

I am having trouble generating new points withing an X-Y range that are connected up to make triangles via triangle fan.

For example this is expected to work, but per each row requiring 2 positional places, its hard.



float[] points = new float[20*20*3];

int cursor = 0;
for (int x=0; x<20; x++) {
for (int y=0; y<20; y++) {
points[cursor++] = x; // x coordinate of plane of points
points[cursor++] = 0; // 0 height on map
points[cursor++] = y; // z coordinate of plane of points
}
}


Yet this code doesn’t come out because I have to stagger the points. I am looking for a way to do such a thing, plus generating indices D: I’ve googled a while and nothing but crap posts are present on the subject.

What is the problem exactly?