I am trying to create a procedual dungeon generator.
I have the floor working perfectly and have created a list of edge vertices for the walls.
I duplicate the edge vertices and raise them up by the wall height and now I want to fill in the vertices with the actual wall mesh aka the tris.
This is how it looks
Essentially I have to connect the dots
However I have concluded my winding order is incorrect.
When I generate the edge vertices I run it in a nested for loop that goes along the Z axis first and then the X axis.
for(int z = 0; z < dungeonLength; z++) {
for(int x = 0; x < dungeonWidth; x++) {
// Generate verts here
}
}
All I want it to do is wrap around the level.
So at the end what do I have.
I have a list of vertices, they are not ordered correctly as they go along the Z points first then the X, generating it as it is right now yields broken results
Any advice on how to handle this would be appriciated.