I am currently using this code to generate a four vertex plane:
void Start () {
mf = GetComponent<MeshFilter>();
mesh = mf.mesh;
mr = GetComponent<MeshRenderer>();
verts.Add(new Vector3(-1, 0, -1));
verts.Add(new Vector3(-1, 0, 1));
verts.Add(new Vector3(1, 0, 1));
verts.Add(new Vector3(1, 0, -1));
indices.Add(0);
indices.Add(1);
indices.Add(2);
indices.Add(2);
indices.Add(3);
indices.Add(0);
}
And it works but i need to make a 32 vertex by 32 vertex version of this where all the planes are sharing edges. How would i go about doing this?