Created
July 23, 2017 22:28
-
-
Save doughsay/ef9c48b25e3a86ff12039a552e408e66 to your computer and use it in GitHub Desktop.
Chunk meshing algorithm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for each y going from -1 to MAX_Y: | |
for each x going from -1 to MAX_X: | |
if (x, y) is air: | |
if (x, y + 1) is NOT air: | |
draw a south facing wall at (x, y + 1) | |
if (x + 1, y) is NOT air: | |
draw a west facing wall at (x + 1, y) | |
else: | |
if (x, y + 1) IS air: | |
draw a north facing wall at (x, y) | |
if (x + 1, y) IS air: | |
draw an east facing wall at (x, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment