Creating a tiled mesh at runtime

Sorry to resurrect a dead thread, but this topic is of a lot of interest to me as I think this technique is the only way to increase my frame rate to acceptable levels. The only problem I have is, I have no clue how to modify this to create cubes instead of a flat plane.

I think what I need to do is add an additional xrange (for y in xrange) in between the x and z lines, then add the four additional points I would need to make this a cube. But I’m getting tripped up on actual implementation.

If someone has already done this, or knows how, any chance you can provide some guidance?

Thanks!
ZM