Building the layout…
Voxel Train Yard
Drag empty space to look around · wheel to zoom · drag the levers · click the buttons and switchesDrag to look around · use the desk below

Voxel Train Yard

A voxel-art model railway that runs live in your browser. The scene is an HO scale layout on a wooden table in a hobby room, seen from the eye height of someone standing at the front edge of the table. Everything on it — every rail, building, locomotive, tree, and lever — is generated from code as coloured cubes at page load. There are no downloaded models, textures, or images.

The same voxel train layout at dusk, with lit windows, street lamps, and train headlights
The same layout after dark. Windows, street lamps, headlights, and the lighthouse beam come on as the sun goes down — the full cycle takes about 150 seconds, or you can drag the time knob straight to it.

Controls

Drag any empty part of the room to look around and use the wheel to zoom. The rest of the controls sit on the physical desk along the front edge of the table, and you operate them with the mouse or by touch.

Red lever — Main lineDrag up and down to set the speed of the passenger train and the steam freight on the outer loop.
Blue lever — BranchSpeed of the two trams on the inner loop.
Green lever — YardSpeed of the shunter working back and forth in the freight yard.
Time of day knobDrag left or right to move the sun. Turn off Auto clock first to hold a time.
Lights switchTurns the night lighting on and off: windows, street lamps, headlights, and the lighthouse beam.
Auto clock switchWhen on, the layout runs its own day-night cycle of about 150 seconds per day.
Horn buttonSounds a three-tone horn, synthesised in the browser.
Turntable buttonTurns the engine terminal turntable through half a revolution.
Red stop buttonEmergency stop. Press again to release and let the trains roll.

What is on the layout

How it is built

The page is a single HTML file that loads Three.js from a CDN and nothing else. Static scenery is merged into a handful of large buffer geometries, so the whole layout draws in roughly 130 draw calls and about 100,000 triangles — light enough to hold a steady frame rate on ordinary laptops. Tracks and roads are defined as paths built from straight segments and arcs, and trains, road vehicles, and boats are positioned by arc length along those paths, which is what keeps long trains bending correctly through curves.