본문으로 건너뛰기
AI NEWS JOURNAL
Hacker News Show HNAI NEWS / JOURNAL

Show HN: Compare how codex and Claude Build a procedural octopus jar escape

Article URL: https://keepplain.com/b/build-a-procedural-octopus-jar-escape-in-threejs/vs/build-a-procedural-octopus-jar-escape-in-threejs-cjma,build-a-procedural-octopus-escaping-a-jar-in-threejs,build-a-procedural-octopus-jar-escape-scene-in-threejs Comments URL: https://news.ycombinator.com/item?id=50591321 Points: 1 # Comments: 1

번역 서비스가 일시 중지되어 원문을 표시합니다.

Prompt · the same in both Build a single self-contained HTML file: a real-time 3D scene of an octopus escaping from a glass jar by unscrewing the lid from the inside. ## Scene - A glass jar (cylinder with a threaded neck) sits on a wooden table in a dim room. One warm light source from the side, soft shadows. - The jar is filled with water. Inside is an octopus, fully procedural: a soft mantle, two eyes, eight tentacles with suckers. No external models or textures. - The lid is a metal screw cap sitting on the jar's thread. ## Behavior — this is the core of the task The octopus must actually unscrew the lid. Not a canned animation: the lid's rotation must be driven by the tentacles' contact with it. 1. Idle: the octopus rests at the bottom, breathing, tentacles drifting. 2. Exploration: it rises, several tentacles reach up and touch the lid's underside and rim. 3. Unscrewing: tentacles grip the lid and apply torque. Grip → rotate a fraction of a turn → release → re-grip. Each cycle advances the lid along the thread. The lid should rise as it turns (thread pitch), needing roughly 3–4 full turns to come free. 4. Escape: the lid tilts and falls off onto the table (with a small bounce and sound-free thud), the octopus pulls itself out through the neck and slides onto the table. 5. Loop back to idle in a new jar, or offer a "Reset" button. Tentacles should be driven by inverse kinematics (or an equivalent chain solver) with visible per-segment bending. Suckers should press flat against surfaces they touch. The octopus body should squash through the neck, not clip through it. ## Interactivity - Drag to orbit the camera, scroll to zoom. - Space: pause / resume. - A small on-screen readout: current phase name, lid rotation in degrees, and lid height. ## Visual quality Aim for something people will stop scrolling for. Things that matter: refraction and caustics of the glass and water, the octopus skin (subtle color pulsing like chromatophores), suckers that read as suckers, believable wood and metal. Choose a palette and lighting mood deliberately. ## Constraints - One .html file. Three.js is allowed via a CDN import map (use r165 or newer, ES modules). No other libraries, no external assets, no fetch. - Must run at 60 fps on a mid-range laptop in Chrome. Keep geometry modest; spend effort where it's visible. - No placeholder comments like "// add details here". Everything you describe must be implemented. - Don't ask questions. Make reasonable decisions and ship the complete file in one response. Green is the better of the 4, the difference under each is against Sonnet 5.5. One run each says little about an agent: the task, the repository and the person differ too. Recordings · 4 played from one start Live demos · 4 side by side, started together Next time I would say up front whether “self-contained” permits a CDN dependency, since the delivered HTML still loads Three.js externally. I did not have to redirect the agent; its browser checks and phase-by-phase stepping caught the issues that drove the revisions. I would want one fresh, uninterrupted production run with a clean console before calling the result fully verified. Next time, I’d ask for instrumented, phase-by-phase browser checks in the first prompt, especially for the contact-driven lid. Catching the GLSL compilation error and backward lid rotation, then fast-forwarding through the entire escape loop, made the result verifiable. Next time I'd specify the exact fps target and lighting mood up front since I spent several rounds tuning light color and wood grain after the fact. The live browser inspection loop — checking canvas dataset for phase/angle/torque and screenshots after each patch — was what actually caught issues like stalled torque and let me verify the full unscrew-to-escape cycle without guessing. Next time I'd ask for the contact-driven screw mechanism and a verification harness up front, since that's what actually caught the real bug — tentacles winding around the octopus's own body instead of re-gripping fresh. The fix that mattered was rewriting the arm angle/anchor logic so each tentacle takes an independent grip; the visual polish passes (lighting, water rings, label wording) were secondary. Timelines · on one time scale Sonnet 5.5 · 9 MOMENTS +0Prompt. Build a single self-contained HTML file: a real-time 3D scene of an octopus escaping from a glass jar by unscrewing the lid from the inside. The lid’s rotation must be driven by tentacle contact, with grip–rotate–release cycles and a rise along the thread. +34mAgent did. Built the page shell, camera, dim room, wooden table, glass-and-water jar, and threaded metal lid in separate parts. Added a concatenation script and opened an early stub scene in the browser before building the octopus. +41mAgent did. Added the procedural octopus, eight segmented tentacles with suckers, chain-solving arm code, and the idle, exploration, unscrewing, lid-drop, and escape behavior. Assembled the first full HTML build. +48mAgent did. Browser testing caught a duplicate JavaScript declaration; the agent removed it and resumed stepping through phases. Its debug readout reached the drop phase with the lid at 22.62 radians and 0.270 units of rise. +51mAgent did. Iterated on the scene and inspected exploration, tentacle targets, unscrewing, and successive escape positions in browser screenshots. Adjusted the visuals and behavior while checking the octopus’s passage out of the jar. +58mAgent did. Profiled uneven browser frame pacing, compared scene components and render-target settings, and rebuilt a production page without debug hooks. A visible-pane production measurement later averaged 16.7 ms per frame. +1h 8mAgent did. Investigated a lid that had not settled after falling, changed the drop behavior, and stepped through its position, velocity, bounces, and settled state. Also checked the unscrewing scene at a 375×812 mobile viewport. +1h 11mAgent did. Made a final production-browser check and rebuilt after console reports of a duplicate declaration and WebGL feedback-loop warnings. The subsequent check showed the Idle readout and rendered scene, though the console still reported those messages. +1h 12mOutcome. Delivered one 112,382-byte octopus-jar.html file, loading Three.js r167 from a CDN. The agent reported stepping through the full sequence and measuring roughly 60 fps in its visible browser pane; it did not verify a complete uninterrupted live run or test an integrated GPU. Opus 5.5 · 9 MOMENTS +0Prompt. Build a single self-contained HTML file: a real-time 3D scene of an octopus escaping from a glass jar by unscrewing the lid from the inside. The lid's rotation must be driven by tentacle contact, not a canned animation. +0mAgent did. Built the scene in parts, including the jar, water, lid, procedural octopus, tentacle solver, contact-driven behavior, escape sequence and HUD. Assembled a 1,735-line HTML file, passed a JavaScript syntax check and opened it in a local browser preview. +14mFail. Browser testing exposed a fragment-shader compilation error: the skin shader used `patch`, a reserved GLSL word. +14mAgent did. Renamed the shader variable and resumed browser checks. Added temporary JavaScript simulation hooks to fast-forward and inspect phases without waiting for the browser pane to animate in real time. +16mFail. Phase-by-phase simulation showed the lid could rotate backwards during the unscrewing cycle. +16mAgent did. Corrected the lid rotation and rechecked the cycle. Fast-forwarded through lid release, its fall onto the table, the octopus squeezing through the neck, its slide down the jar and the final on-table phase. +21mAgent did. Refined the water rendering and checked the waterline, tint and caustics in browser views. Rebuilt the file, passed another syntax check and inspected the scene during unscrewing. +23mAgent did. Checked close-ups and verified that the escape fades into a new jar. The browser reported 25 shader programs with none marked bad; a 60-frame check measured about 0.68 ms of simulation and 1.10 ms of rendering per frame. Removed debug hooks for the final build. +24mOutcome. Delivered one 87,573-byte HTML file and removed the temporary preview configuration. The agent tested a complete loop through a local web server, but did not test opening the file directly from disk; the file loads Three.js r170 from a CDN. gpt-6.1-sol · high · 10 MOMENTS +0Prompt. Build a single self-contained HTML file: a real-time 3D scene of an octopus escaping from a glass jar by unscrewing the lid from the inside, with IK tentacles, contact-driven lid torque, refraction/caustics, and a readout UI. +3mAgent did. Planned the visual style (brass, walnut, teal glass, coral octopus) and wrote the initial octopus-escape.html (309 lines) with friction-limited tentacle contacts driving thread rotation and lift. +16mAgent did. Started a local HTTP server and opened the scene in a browser tab to inspect live state via canvas dataset (phase, lid angle, torque, grips) and screenshots. +19mAgent did. Adjusted lighting (hemisphere and spot light colors/intensity) and re-ran the scene, confirming phase progressed from unscrew to finished with lid lift of 0.3675. +21mAgent did. Refined the escape-phase motion curves (root position and tilt interpolation) and reloaded to check the updated glass, lighting and character animation. +22mAgent did. Verified pause control and tentacle torque progression toward full lid rotation, reporting steady 57-60 fps; softened wood grain and lighting for visibility. +24mAgent did. Tweaked mantle geometry/scale and escape-phase timing curves in two more patches to improve the squeeze-through-neck motion. +26mAgent did. Updated the readout UI markup and verified the full escape cycle completes: lid detaches at 1260°, bounces onto the table, octopus settles beside jar with no wall penetration. +27mAgent did. Tested pause/resume via keyboard, extracted the script for inspection, and verified the Reset button returns the scene to idle phase at 0° lid angle. +29mOutcome. Delivered one self-contained HTML file (octopus-escape.html, +351/-22 lines total), browser-tested through the full escape cycle at ~56-60 fps with working pause and reset controls. gpt-6-astra · high · 9 MOMENTS +0Prompt. Build a single self-contained HTML file: a real-time 3D octopus escaping a glass jar by unscrewing the lid from the inside, using IK tentacles, contact-driven screw mechanics, caustics, and chromatophore skin pulsing. +0mAgent did. Looked up prior similar builds for pitfalls, then wrote octopus.html: procedural jar, water, wood table, and an octopus with IK tentacles; lid modeled as a constrained rotating body where tentacle grip forces drive rotation and thread pitch converts it to height. +7mAgent did. Verified the script's JS syntax, started a local server, opened a browser tab to preview, and inspected contact forces and screw progress via page state. +10mAgent did. Refined visuals: tuned environment map intensity, cap color, and added subtle water ring details after reviewing the first screenshots. +11mAgent did. Built a verification harness (local server + timed checkpoints) to replay the sequence at specific timestamps and check phase/simulation data in the DOM. +13mFail. Phase checks across the 3.5 turns revealed a re-gripping bug: tentacles were winding around the octopus's own body instead of taking a fresh grip within reach. +13mAgent did. Rewrote the arm angle/anchor logic so each tentacle takes a fresh grip in its own reach, then re-verified across all turns and reloaded to confirm the fix held. +14mAgent did. Inspected the final escape pose and screenshots, then relabeled the on-screen readout from 'LID LIFT' to 'LID HEIGHT' to show absolute lid position. +14mOutcome. Full sequence verified end-to-end: ~58 seconds runtime, 3.5 full turns of the lid, cap pops free with a bounce, octopus squeezes through the neck and exits onto the table.

자료 출처

원문 읽기 ↗

관련 주제

← 전체 소식 이어 읽기