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 · 未声明许可