programextensions/scene/demos/voxels-chunk.xtl

Voxels, 1: a chunk is an array. 16 by 16 by 16 block numbers built from a height field in a few array expressions -- grass, dirt, stone, water below a level, sand at its shore, one tree -- then counted, cut and seen from above. (docs/voxels.md; the next demos draw it.) Run: just demo scene voxels-chunk (pictures go to work/draw/)

source · imports vx: extensions/scene/demos/Voxels.xtl

h : Int

value · line 9
h ← ᵛˣh̲ills 0.0

b : Int

value · line 12
b ← ᵛˣc̲hunk h

t : Int

value · line 24
t ← ᵛˣt̲op b

p : Char

value · line 26
p ← ⎕S̲HOW ⎕G̲RID t

p : Char

value · line 27
p ← ⎕S̲HOW ⎕G̲RID r̲ev (1 + 8 s̲elect b)