Previously I added in the values after each chunk (the world is divided into smaller chunks) goes through MS. This means that the values in the chunk itself will not be recognized by the main Grid, which MS uses to get density values. It is only after the chunk is added to the main Grid that Grid will return intended values.
So what I did was simply add the chunk to Grid right after the values are generated, then use MS.
This is what was originally supposed to happen:
Yes, this is going to be terrain later. It's pretty boring. Here values are generated as follows:
- If the y-coordinate is less than or equal to 0, output 1 (solid).
- If the y-coordinate is greater than 0, output -1 (empty).
Now let's make it a little more interesting using 1 or -1 randomly:
Last one: any number (decimals) from -1 to 1:
You can read stuff on Marching Squares if you're interested on how this stuff works. I will later use Perlin noise to generate terrain.
.png)
.png)
.png)
No comments:
Post a Comment