If you have a maze of size 5x5, then the maze has 25 sections.
Each section is created separately, without scanning neighboring sections to cut down on triangles or anything.
If you look ate the Maze.dat file using Notepad (it's a simple ASCII textfile), you'll see that each section has a single-char code, using values 1-9 and A-F.
If you take the bitmap and the Maze.dat file, you can see which section-structure has which code.
I've all forgotten them, because it was a project of more than 1 year ago.
But all sections are joined into 1 big mesh, as the maze-generator code (which creates the layout of the maze) was code from a Visual Basic project, which I found on the Internet.
There each section was created using separate meshes and a maze of size 10x10 was lagging like hell (that maze had 100 separate meshes and thus 100 separate surfaces).
Now even a maze of size 50x50 runs smooth, because it's only 1 big mesh with only 1 surface.
Indeed, this results in more triangles as there is no real optimization.
But when you look at the code, you will see that a "long wall" has 4 triangles.
2 triangles are for creating the wall, the other 2 are for creating the top of the wall.
If you press the spacebar (deactivate gravity) and then Z or S (going up or down respectively), you'll see that the walls are not actually open when you look down.
You can also walk on top of the walls.
Pressing spacebar toggles gravity on/off (default is On), pressing z and s raises or lowers the camera in height, so you can see the maze from above.
But this was my first attempt to create meshes using code, so it's not that bad for a first try, is it?
Optimizing the maze would cut down on vertices and triangles, but then each section would need to scan all surrounding sections to see if a wall can be created that's longer than one section (joining 2 or more sections together).
This would go beyond my programming skills.
Each section is created separately, without scanning neighboring sections to cut down on triangles or anything.
If you look ate the Maze.dat file using Notepad (it's a simple ASCII textfile), you'll see that each section has a single-char code, using values 1-9 and A-F.
If you take the bitmap and the Maze.dat file, you can see which section-structure has which code.
I've all forgotten them, because it was a project of more than 1 year ago.
But all sections are joined into 1 big mesh, as the maze-generator code (which creates the layout of the maze) was code from a Visual Basic project, which I found on the Internet.
There each section was created using separate meshes and a maze of size 10x10 was lagging like hell (that maze had 100 separate meshes and thus 100 separate surfaces).
Now even a maze of size 50x50 runs smooth, because it's only 1 big mesh with only 1 surface.
Indeed, this results in more triangles as there is no real optimization.
But when you look at the code, you will see that a "long wall" has 4 triangles.
2 triangles are for creating the wall, the other 2 are for creating the top of the wall.
If you press the spacebar (deactivate gravity) and then Z or S (going up or down respectively), you'll see that the walls are not actually open when you look down.
You can also walk on top of the walls.
Pressing spacebar toggles gravity on/off (default is On), pressing z and s raises or lowers the camera in height, so you can see the maze from above.
But this was my first attempt to create meshes using code, so it's not that bad for a first try, is it?
Optimizing the maze would cut down on vertices and triangles, but then each section would need to scan all surrounding sections to see if a wall can be created that's longer than one section (joining 2 or more sections together).
This would go beyond my programming skills.