Download

Procedural mesh triangle striping

Hey all,
I’m working with procedural mesh components to create a heightmapped sphere. So far, so good. I was hitting triangle limits on a full-sized version of the mesh, so I decided to split it into 4 quad-wide strips across the planet in rings. Here, however, I’ve got an issue: each ring has a one-quad ‘gap’ between them, thus striping the mesh. This wasn’t an issue with the mesh before I decided to split it into pieces, so my guess is that my triangle indexing is broken somehow. Here’s the triangle code I’m using:



int indicesIndex = 0;
	for (int y = 0; y < 4; ++y)
	{
		for (int x = 0; x < GRID_WIDTH; ++x)
		{
			int start = y * GRID_WIDTH + x;
			planetstuff.triangles.push_back((short)start);
			planetstuff.triangles.push_back((short)(start + 1));
			planetstuff.triangles.push_back((short)(start + GRID_WIDTH));
			planetstuff.triangles.push_back((short)(start + 1));
			planetstuff.triangles.push_back((short)(start + 1 + GRID_WIDTH));
			planetstuff.triangles.push_back((short)(start + GRID_WIDTH));
		}
	}


and here’s an image of the striping: Dropbox - File Deleted

Any help would be greatly appreciated!