docs: fix MATH_MARCHING_CUBES §4 polarity + dims

Task 17 corrected the density sign convention in §1-§2 but left §4's worked
example on the old inverted convention, so the doc contradicted itself. §4 now
matches: negative is underground, positive is air. Also corrects a stale
16x16x64 chunk reference to 24x24x256.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stewart Howe 2026-08-05 21:32:51 -04:00
parent 1f7613439a
commit 783ee8b016

View file

@ -45,16 +45,17 @@ Instead of writing 256 `if/else` statements, the algorithm uses a hardcoded **Lo
### 4. Linear Interpolation (Why it looks Smooth) ### 4. Linear Interpolation (Why it looks Smooth)
If the algorithm just drew triangles exactly halfway between the inside and outside corners, the terrain would still look a bit jagged (like a low-poly PS1 game). If the algorithm just drew triangles exactly halfway between the inside and outside corners, the terrain would still look a bit jagged (like a low-poly PS1 game).
To make it perfectly smooth, we **Interpolate**: To make it perfectly smooth, we **Interpolate**. Remember the sign convention from §1 —
* Corner A has a density of `1.0` (Very solid). negative is underground, positive is air:
* Corner B has a density of `-0.1` (Just barely in the air). * Corner A has a density of `-1.0` (deep underground, very solid).
* Because `-0.1` is much closer to our `0.0` Iso-Level than `1.0` is, the algorithm slides the triangle vertex much closer to Corner B. This creates gentle slopes and sharp cliffs dynamically. * Corner B has a density of `0.1` (just barely up in the air).
* Because `0.1` is much closer to our `0.0` Iso-Level than `-1.0` is, the algorithm slides the triangle vertex much closer to Corner B. This creates gentle slopes and sharp cliffs dynamically.
--- ---
## ⚙️ The Execution Loop (What our C# Script will do) ## ⚙️ The Execution Loop (What our C# Script will do)
When the Server tells the Client to render a 16x16x64 chunk, the mesher does this: When the Server tells the Client to render a 24x24x256 chunk, the mesher does this:
1. Loops through every X, Y, Z coordinate in the chunk. 1. Loops through every X, Y, Z coordinate in the chunk.
2. Checks the 8 corners of the current voxel. 2. Checks the 8 corners of the current voxel.
3. Creates an `8-bit integer` (a byte) based on which corners are solid (e.g., `00001111`). 3. Creates an `8-bit integer` (a byte) based on which corners are solid (e.g., `00001111`).