ai21.net
語言

運河風車3D場景模型對比

示範影片

運河風車3D場景模型對比 — 1

提示詞

Build "Lock Jelly." — a single self-contained HTML file (WebGPU + WGSL, no libraries, no network, works from file://), part of a "Material Studies" series of jelly dioramas. If WebGPU is missing or the adapter fails, show a clean fallback card instead of the scene.

CONCEPT
A square block of clear coloured jelly (about 5.2 × 5.2 units, ~2 units high) holding a little English canal scene. The canal runs along the FRONT edge of the block, so the block's front face cuts the water lengthways: you see the lock chamber in cross-section, the water inside it rising and falling between the gates, fish swimming, the boat's hull below the waterline. All cut faces show candy-coloured soil strata; under the pounds a blue-grey puddle-clay lining, under the chamber a brick invert on a concrete bed, under the fields brown earth and turf.

LAYOUT (left to right along the front)
- Upper pound on the left at the higher level, opening into a round winding hole (a bay for turning boats); near the lock it narrows between brick wing walls.
- The lock chamber in the middle: brick walls with dressed-stone quoins and coping, a slimy band between the two water levels and weed below, an iron ladder, a gauge board, a stone cill under the top gate, recesses that the open gates fold into.
- Below the bottom gate a short walled tail, then the lower pound bends away from the front face, runs under a humpback brick bridge into a basin with a willow-covered island, lily pads in its corners and a sunken bicycle on the bed.
- The ground steps down from an upper terrace to a lower one along a grassy bank.
- Behind the lock: stone setts around the chamber, bollards, a gravel towpath, a lane, the keeper's whitewashed cottage with a slate roof, green door, picket-fence garden full of flowers and washing flapping on a line, a gas lamp, a bench, a white windmill with turning lattice sails, oaks, willows, poplars, a hedge, sheep, reeds on the soft banks.

WATER
- Linear shallow-water waves on a staggered grid (~168²) with a little surface tension, so short ripples are springy like jelly; damping and firmness are adjustable.
- Three separate bodies of water — upper pound, chamber, lower pound — each with its own rest level. Faces between bodies stay shut unless the gate between them is open and the levels are equal. The chamber's level is moved bodily when paddles are drawn (Torricelli-style flow), with boils, white water and a dimple at the intake.
- Rendering: refraction of the scene behind, flavour-coloured absorption, sun caustics on the bed, soft light shafts, foam (wakes, paddle churn), a meniscus line on the cut faces. Split the surface mesh along the gate lines so the step in level at a shut gate is a clean wall hidden by the gate leaf, not a ramp.
- The block itself can be tipped by dragging its side; the jelly shears and wobbles, the water sloshes, and it settles back.

THE LOCK AND THE KEEPER
- Two single-leaf timber gates (planks, rails, diagonal brace, iron straps, a walkway with a handrail), each with a white balance beam with black bands. Ground-paddle pedestals with toothed racks that rise when wound.
- An articulated lock keeper (flat cap, navy jumper, cords, windlass in hand; torso, arms, thighs and shins as separate parts). He walks with a proper gait, plans his route around the bench, pedestals, bollards and any beam lying across his way (going round the beam's end), leans his back on a beam and walks it round backwards to swing a gate, winds the windlass with his arm circling the spindle, and sits on his bench between jobs. He sets off for the gate as the boat comes in.
- The cycle: the boat lies in the full chamber → keeper shuts the top gate → winds up the bottom paddles → the chamber empties into the tail with white water → winds them down → opens the bottom gate → the boat leaves, runs the tail, swings round the bend, ducks under the bridge, goes round the island and comes back into the chamber bow first → shut bottom gate → round to the top paddles → chamber fills with boils → open the top gate → the boat goes up the pound, turns in the winding hole and comes back. Repeat forever. A gate may only open when the levels match.

BOATS
- A traditional narrowboat "Wobble": black lofted hull, a green cabin with red lining-out, brass portholes, a cratch board and cover at the bow, a chimney with brass bands (puffing smoke), a painted Buckby can, plank and pole on the roof, rope fenders, a headlamp, a brass swan-neck tiller and a steerer in a red jumper. It follows smooth filleted routes (check the stern never swings out through the block's face), slows near the gates, heaves, pitches and rolls on the local surface, and hands its displaced volume back to the water so it makes bow waves and wakes.
- Three moored narrowboats in the basin in different liveries with flowerpots on the roofs and one ginger cat, tied to bank pins with stretchy mooring lines.

LIFE
- Roach, perch and bream as boids that stay in their own body of water (they can only move between pound and chamber while a gate is open), under the surface and hulls, off the bed, scattering from the boat and splashes.
- Mallards (drakes, ducks) and a duck with four ducklings that follow exactly along her trail; a pair of mute swans in the basin. They paddle the surface, ride the chamber down and up, upend now and then, get out of the boat's way and come for bread.
- A grey heron that wades in the shallows or stands on a moored boat's roof, stabs at fish (sometimes catching one), and flaps off somewhere quieter when the boat passes or someone toots.
- Chimney smoke from the boat and the cottage.

UI (editorial, like a print magazine)
- Top-left: small caps eyebrow "MATERIAL STUDIES", a huge italic serif title "Lock / Jelly.", a short subtitle. Top-right: a status pill "WebGPU · Live / Paused / Unavailable".
- Right: a frosted-glass control panel (a bottom sheet on mobile) with: buttons Hurry (speeds the keeper, paddles and boat), Toot (horn; also Space), Throw bread, Rubber duck (drops a yellow rubber duck that floats upright, can be picked up and thrown, rides the lock, is stopped by gates and shoved by boats); a liveliness meter; tallies Trips · Lockfuls · Fed; a status line "Wobble — Emptying the lock 62%" telling the story step by step; three flavours Greengage, Elderflower, Blackcurrant (change the water colour/absorption and strata); sliders Firmness, Wave damping, Paddle speed; Reset, Pause, Sound on/off, View.
- Bottom-left: "How to play — Throw bread. Toot the horn. Hurry the keeper." with a small line of instructions.
- Interaction: drag across the water to make waves, drag the block's side to tip it, pick up and throw rubber ducks, drag empty space to orbit, scroll/pinch to zoom; touch works.
- Soft studio lighting on a warm paper backdrop with the block's tinted, caustic-flecked shadow; WebAudio sounds: the boat's horn, the gate thudding shut, a creak, the windlass ratchet, and the rush of water that swells with the flow.

QUALITY
Keep it smooth (fixed-step physics, cheap per frame), no console errors, no page scroll, works at phone width. Test it headlessly: a full round trip happens, levels go exactly from upper to lower and back, no gate opens across a step, the keeper never walks into the water or through obstacles, the boat never touches a gate leaf, and every button works.

中文翻譯

構建 “Lock Jelly.” —— 一個單獨的自包含 HTML 文件(WebGPU + WGSL,不使用任何庫、不聯網,可直接從 file:// 運行),屬於 “Material Studies” 果凍微縮立體模型系列。如果缺少 WebGPU 或適配器失敗,就顯示一張乾淨的降級提示卡,而不是場景。

概念
一塊方形的透明着色果凍(約 5.2 × 5.2 單位,高約 2 單位),裏面容納着一小段英式運河場景。運河沿着方塊的前邊緣延伸,因此方塊的前表面縱向剖開了水面:你能看到閘室的橫截面、閘室裏的水在兩道閘門之間漲落、魚在遊動,以及船體位於水線以下的部分。所有剖面都呈現出糖果色的土層;水段下方是藍灰色的膠泥襯層,閘室下方是鋪在混凝土基牀上的磚砌仰拱,田野下方是棕色泥土和草皮。

佈局(沿正面從左到右)
- 左側是處於較高水位的上水段,展開成一個圓形的回船塘(供船隻掉頭的港灣);靠近船閘處,它在磚砌翼牆之間收窄。
- 中間是閘室:磚牆配以修整過的石質隅石和壓頂,兩個水位之間有一道黏滑的水痕帶,其下長着水草,還有一架鐵梯、一塊水位標尺、上閘門下方的一道石質門檻,以及開啓的閘門折入其中的凹槽。
- 下閘門以下是一段短短的帶護牆尾水渠,隨後下水段拐離前表面,從一座駝峯形磚橋下穿過,進入一處港灣;港灣裏有一座長滿柳樹的小島,角落裏浮着睡蓮葉,水底躺着一輛沉沒的自行車。
- 地面沿着一段草坡,從上層臺地逐級降到下層臺地。
- 船閘後方:閘室周圍鋪着小方石,立着系船柱,有一條碎石纖道、一條小巷、守閘人那座刷了白灰的小屋(石板瓦屋頂、綠色門),還有一道尖樁柵欄圍起的花園,裏面開滿鮮花,晾衣繩上的衣物隨風拍動;此外還有一盞煤氣燈、一張長椅、一座白色風車(格柵狀葉片正在轉動)、橡樹、柳樹、楊樹、一道樹籬、羊羣,以及鬆軟河岸上的蘆葦。

水體
- 在交錯網格(約 168²)上模擬線性淺水波,並帶有一點表面張力,讓細小的漣漪像果凍一樣富有彈性;阻尼和硬度均可調節。
- 三塊彼此獨立的水體——上水段、閘室、下水段——各自擁有自己的靜水位。各水體之間的界面保持封閉,除非兩者之間的閘門已打開且水位相等。當閘板被提起時(托裏拆利式水流),閘室水位整體升降,並伴隨翻湧、白水以及進水口處的一處凹陷。
- 渲染:折射後方的場景,帶有隨風味着色的吸收效果,水底有太陽焦散,柔和的光柱,泡沫(尾跡、閘板攪動),以及剖面上的一道彎液麪線。沿閘門線拆分水面網格,使關閉的閘門處的水位落差成爲一堵被閘門門扇遮住的乾淨直牆,而不是一段斜坡。
- 拖動方塊的側面可以使其傾斜;果凍隨之剪切、晃動,水也晃盪起來,隨後恢復平靜。

船閘與守閘人
- 兩扇單扇木閘門(木板、橫檔、斜撐、鐵箍、帶扶手的步道),每扇都有一根帶黑色環帶的白色平衡梁。地面閘板的基座帶有齒條,搖動時齒條會升起。
- 一個有關節的守閘人(鴨舌帽、藏青色套頭衫、燈芯絨褲、手持搖柄;軀幹、雙臂、大腿和小腿爲獨立部件)。他以自然的步態行走,會規劃路線繞過長椅、基座、系船柱以及任何橫在路上的平衡梁(從梁的末端繞過去),把背靠在樑上,倒退着繞行推梁,從而轉動閘門;他搖動搖柄時手臂繞着軸轉圈,工作間隙則坐在長椅上。船一駛入,他就動身走向閘門。
- 循環:船停在灌滿水的閘室裏 → 守閘人關上上閘門 → 搖起下閘板 → 閘室的水帶着白浪排入尾水渠 → 搖下閘板 → 打開下閘門 → 船駛出,穿過尾水渠,繞過彎道,從橋下鑽過,繞着小島轉一圈,再以船頭朝前回到閘室 → 關上底部閘門 → 繞到上閘板處 → 閘室在翻湧中注滿 → 打開上閘門 → 船駛上上水段,在回船塘裏掉頭,然後回來。永遠重複。只有當兩側水位一致時,閘門纔可以打開。

船隻
- 一艘傳統窄船 “Wobble”:黑色放樣船體,綠色船艙配紅色描邊,黃銅舷窗,船首有一塊 cratch 板和罩布,一根帶黃銅箍的煙囪(冒着煙),一隻彩繪的 Buckby 水罐,船頂放着木板和撐篙,繩制護舷,一盞前燈,一根黃銅鵝頸舵柄,以及一位穿紅套頭衫的舵手。它沿着平滑的圓角路線行駛(檢查船尾絕不能甩出方塊的表面),在閘門附近減速,隨當地水面升沉、縱搖和橫搖,並將它排開的體積交還給水體,從而掀起船首波和尾跡。
- 港灣裏停泊着三艘窄船,塗裝各不相同,船頂放着花盆,還有一隻橘貓,它們用有彈性的繫泊纜繩拴在岸邊的系船釘上。

生命
- 擬鯉、河鱸和歐鯿以 boids 羣體形式活動,各自待在自己的水體中(只有在閘門開啓時,它們才能在水段與閘室之間移動),位於水面和船體之下、離開水底,遇到船隻和水花便四散遊開。
- 綠頭鴨(雄鴨、雌鴨),以及一隻帶着四隻小鴨的母鴨,小鴨會精確地沿着她的軌跡跟隨;港灣裏還有一對疣鼻天鵝。它們在水面劃水,隨閘室下降和上升,不時把頭扎進水裏,給船讓路,還會遊過來討麪包。
- 一隻蒼鷺在淺水處涉水,或站在停泊船隻的船頂,朝魚猛啄(有時能捉到一條),當船經過或有人鳴笛時,便拍翅飛往更安靜的地方。
- 船和小屋煙囪冒出的煙。

UI(編輯風格,像一本印刷雜誌)
- 左上角:小型大寫字母的眉題 “MATERIAL STUDIES”,一個巨大的斜體襯線標題 “Lock / Jelly.”,一段簡短的副標題。右上角:一個狀態膠囊 “WebGPU · Live / Paused / Unavailable”。
- 右側:一塊磨砂玻璃控製麪板(移動端爲底部抽屜),包含:按鈕 Hurry(給守閘人、閘板和船提速)、Toot(鳴笛;也可按空格鍵)、Throw bread、Rubber duck(放下一隻黃色橡皮鴨,它會直立漂浮,可被拿起並拋出,會隨船閘升降,會被閘門擋住,也會被船推開);一個活躍度儀表;計數 Trips · Lockfuls · Fed;一行狀態文字 “Wobble — Emptying the lock 62%”,逐步講述當前故事;三種風味 Greengage、Elderflower、Blackcurrant(改變水色/吸收效果和土層);滑塊 Firmness、Wave damping、Paddle speed;Reset、Pause、Sound on/off、View。
- 左下角:“How to play — Throw bread. Toot the horn. Hurry the keeper.” 並附一行小字說明。
- 交互:在水面上拖動以製造波浪,拖動方塊側面使其傾斜,拿起並拋出橡皮鴨,在空白處拖動以環繞觀察,滾動/雙指捏合以縮放;觸屏操作可用。
- 溫暖紙色背景上的柔和攝影棚燈光,方塊投下帶色調、點綴着焦散光斑的陰影;WebAudio 音效:船的喇叭聲、閘門砰然關閉的悶響、一聲吱呀、搖柄的棘輪聲,以及隨水流增強的水聲。

品質
保持流暢(固定步長物理,每幀開銷低),不得出現控制臺錯誤,頁面不得滾動,在手機寬度下也能正常工作。以無頭方式測試:能完成一次完整的往返,水位精確地從上水段水位降到下水段水位再升回來,不得出現閘門在兩側存在水位落差時開啓的情況,守閘人絕不能走進水裏或穿過障礙物,船絕不能碰到閘門門扇,每個按鈕都能正常工作。

溯源

原作者
vib3coded
發佈日期
2026-10-14(由推文 ID 反解)
原始出處
查看原帖 ↗
收錄來源
zhuyansen/awesome-opus-5.5-video · 2110329593441796383 · 未聲明授權