A Day in a Miniature City
A tilt-shift time-lapse of a European harbour city over one day: golden light on terracotta roofs, windows lighting up at blue hour, lit bridges in the river at night, sunrise mist, working cranes, trams and trains. Drag, zoom and scrub time.
Made in Claude Code (Claude subscription) with claude-opus-5.5. The agent wrote code, looked at the preview and fixed it over several iterations. This is not a single-shot result: comparisons on this site show models in one attempt.
Starting prompt
Build "A Day in a Miniature City": a real-time 3D time-lapse of a European harbour city on a river, filmed from a hill through a tilt-shift lens over one compressed day. It must look like real footage: real materials, real trees, real water and traffic, and only the lens makes it look like a model (a narrow band of focus, a high viewpoint, slightly boosted saturation). Nothing toy-like or low-poly, and no people anywhere. Single self-contained HTML file; Three.js and its addons from a CDN via an import map are fine; build everything procedurally, no external models or image files. The city (metres, y up; the river runs west to east, about 105 m wide, between stone quay walls 6 m above the water): - An old town on the north bank: slightly irregular perimeter blocks of 4 to 6 storey houses (frontages 8 to 20 m, floors about 3.2 m) around courtyards with trees. Plaster façades in ochre, cream, rose and grey with window grids, sills, shutters, curtains, shopfronts, cornices and weathering; steep terracotta hip and gable roofs with tile rows, moss and colour variation, chimneys and dormers. Grey slate roofs in the 19th-century districts beyond. - A Gothic cathedral on its own square: an 80 m nave with flying buttresses and tall traceried windows under a steep copper-green roof, a transept, a polygonal apse with an ambulatory and a west tower with a spire about 110 m high. A market square with a town hall tower. - Tree-lined avenues, a riverside promenade and a park. Trees must look real: every crown a different lumpy shape with gaps, sunlit tops and dark undersides, light glowing through the leaves at low sun, trunks visible below. - A stone bridge of five arches with cutwaters, parapets and lamps; upstream, a steel truss railway bridge on stone piers. The railway continues on a brick viaduct through an elevated station. - The river: dark green water with planar reflections, wind ripples, sun glitter and wakes behind boats. - To the east, a harbour: a container terminal with four ship-to-shore gantry cranes working a berthed container ship (trolleys and spreaders moving containers between ship and quay), container stacks, terminal trucks, floodlight masts, brick warehouses on the far quay, a ferry crossing the river and barges passing under the bridges. - Streets with lanes, markings and zebra crossings, parked cars along the kerbs; cars, city buses and articulated trams that follow their lanes, keep their distance and stop at traffic lights that cycle. Tinted windows, no visible drivers; headlights, tail and brake lights after dusk. Passenger and freight trains on the viaduct; passenger trains stop at the station. - Beyond: outer districts, wooded hills and the open sea to the east. The look: - A high viewpoint, 15 to 55 degrees down, from 250 to 800 m away. The tilt-shift is a depth-of-field pass driven by the depth buffer: a narrow sharp band at the focus distance, blur growing smoothly in front and behind, no halos around in-focus edges, round bokeh on lights at night. Saturation and contrast slightly boosted, a soft vignette. - Sun and sky by time of day, crisp shadows fitted to the view, soft ambient occlusion in street canyons and courtyards (from a height map of the city), aerial haze, clouds whose shadows drift across the roofs. - ACES filmic tone mapping, sRGB output, bloom only on bright lights. Never muddy, never washed out. Smooth on a laptop: instance buildings, roofs, trees and vehicles, merge static geometry. The day (1x = a whole day in 2 minutes; the loop is seamless): - Late afternoon into golden hour: long warm shadows, glowing roofs, light through the trees. - Sunset and blue hour: windows light up one by one in warm tones, then street lamps, headlights and tail lights. - Night: lit bridges and quay lamps reflected as long streaks in the river, a floodlit cathedral, the terminal under floodlights with the cranes still working. - Dawn and sunrise: lights going out, mist lying on the river and thinning as the sun climbs. - Midday: high sun, sharp short shadows, saturated colours; then back into the afternoon. The film: from the very first frame, with no input, a self-running demo of slow crane-like camera moves plays through the whole day, one loop per day: a wide opening over the river and old town, the stone bridge at blue hour, the river and the lit station at night, the floodlit cranes, the misty river mouth at sunrise, a glide over the roofs and traffic past the cathedral spire, the bridge at noon, and back. The frame at 8 seconds is the city in warm golden light. Interface: - A compact glass panel: a tiny clock with the phase of the day, a time-of-day scrubber that moves with the day, speed buttons (pause, 1x, 5x, 15x, 30x), a tilt-shift toggle and a Film button. Thumb-sized on a phone. - Drag to orbit; wheel or pinch to zoom towards the point under the cursor, close enough for one street corner, a crane or the bridge; the focus band follows what you zoom on. All camera motion eased. - Any input takes over; after 20 seconds without input the film resumes smoothly. - Keyboard: Space pause, 1 to 4 speeds, T tilt-shift, arrows scrub the time, R back to the film; listed in a tiny hint. Touch orbit and pinch work on a phone without zooming the page. Engineering rules (the page must work on the first load, with no fixes): - Use Three.js r170 and only methods that exist on each of its classes. Give every custom ShaderMaterial `fog: false`, and declare every uniform, constant and varying its shaders use. - Declare each identifier once. Inside one calculation, never reuse a shared scratch vector for two values that are both still needed; use local vectors. - Guard every animated value against NaN. - Answer with the complete file exactly once, in a single ```html code block: no drafts, partial snippets or notes. Keep planning brief and write the code. Aim for roughly 1,400 to 2,200 lines, compact and well structured.