Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

道场 — Shrine Room

Source: examples/3d-rooms/ling-dao-chamber.ling

A quiet Chinese-Japanese shrine drawn only with vector geometry (vtex_*), with no pixel fills. Everything moves slowly in a gold, jade and crimson palette, and a soft pentatonic bell chord plays in the background. The program is written mostly with Thai keywords and builtins, with a few Chinese names mixed in.

Run it from the repository root:

ling run examples/3d-rooms/ling-dao-chamber.ling

What’s in the room

PartBuilt with
Torii gate at the far endvtex_torii
Five-tier pagoda behind the gatevtex_pagoda
Altar mandala: gear ring, dharma wheel, lotus, ringsvtex_spiked_cog, vtex_chakra, vtex_lotus, vtex_rings
Stone-tile floor with a yantra bordervtex_grid, vtex_yantra
Star lantern on the ceilingvtex_star, vtex_rings
Ink-brush panels on the side wallsvtex_letter_rain, vtex_lotus
Four corner pillarsvtex_rings, vtex_spiked_cog, vtex_lotus

Sound

Five tones form a Chinese pentatonic scale, 宫 商 角 徵 羽 (C4, D4, E4, G4, A4), plus a faint sub-bass. Each tone is placed in 3D space with audio_tone, and audio_listener follows the camera, so the bells shift as the view swings.

Camera and light

The camera swings like a slow pendulum, about 30 degrees to each side, always facing the altar. Five lights (add_light) give a gold overhead lamp, a warm altar glow, jade and crimson accents on the pillars, and a lamp at the gate.

Ideas to try

  • Change the hue anchors GOLD, JADE and CRIMSON at the top of the file.
  • Speed up the camera by raising orbit_spd.
  • Change the frequencies in init_audio to try a different scale.

See 3D Shapes and Meshes and Audio for the builtins used here.