Vector3* vertices; int size = 256*256; vertices = new Vector3[size]; int x,z; x=z=0; for (int i=0;i<size;i+=1) { vertices[i].x = x; vertices[i].y = 0; vertices[i].z = z; error("%d = %d,%d,%d", i, vertices[i].x, vertices[i].y, vertices[i].z); i++; vertices[i].x = x; vertices[i].y = 0; vertices[i].z = z+1; // Dump our vertices by triangle strip. error("%d = %d,%d,%d", i, vertices[i].x, vertices[i].y, vertices[i].z); x++; if (x == 256) { z++; x = 0; } }

The error() function is just a simple function that dumps whatever I print into a log.txt file.

Now the weird thing is the first 2 values are correct. The x,y and z coordinates are all set to 0 as expected, but on the next iteration of the loop, the x and z values are fine but the y value is an absurdly high arbitrary number like 238573937. Any ideas as to why this would be?