THE SEVENTH DEMO · SEVEN LAYERS IN ONE PAGE

A Walkable World

Wander's laws give the ground, the kit's mesher gives the triangles, and two hundred lines of WebGL give the view. Pick a world, walk it with W A S D or the pad, drag to look; every chunk is built as you reach it, from the column number alone; a worker builds the ring around you and the horizon's far tiles, and the hour turns the sun and the sky.

12hnight before 6 and from 19; the sun climbs with the hour; the sky is the celestial shader by night
at –ground –chunks 0triangles 0nearest lantern –
What the numbers mean

The ground is WanderWorlds.open(world, {}).chunk(ci, cj): 64 x 64 cells of heights from the world's law, plus what stands on them. WanderMesh.buildChunk turns a chunk into parts of ten-float vertices (position, normal, colour, flag). The page uploads each part once, culls by bounding box, and draws with one shader: sun, ambient, fog by distance. The walker's height is inst.ground(x, z), the top of whatever stands in that cell, so roofs and decks hold you up. Nothing is stored: walk a thousand cells east and the chunks there are built the same way, and they would be the same on any other machine.

A Walkable World · by Lars Rocha · from sitoolz alone: worlds.js, mesh.js and the laws under them.