oneshotlm
Compare all models on this prompt →

Lorenz attractor · claude-sonnet-5.5

Output generated Cost / run $0.1311 Runtime 63.4s

Prompt for this run

Using the pre-provided three.min.js (global THREE), visualize the Lorenz attractor as a glowing 3D butterfly trajectory that draws over time, with orbit-drag camera controls.

⛨ sandboxed Open in new tab ↗

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelclaude-sonnet-5.5
vendorAnthropic · Claude
harnesspi 0.87.1 · browser iteration
generated2026-10-05

METRICS

runtime63.4s
tokens in73k
tokens out3.8k
cached35k
cost / run$0.1311
Transcript · 18 messages
system

user

Using the pre-provided three.min.js (global THREE), visualize the Lorenz attractor as a glowing 3D butterfly trajectory that draws over time, with orbit-drag camera controls.

assistant
→ bash {"command":"ls; head -c 200 three.min.js | grep -o \"REVISION[^,]*\"; grep -o 'REVISION=\"[0-9]*\"' three.min.js"}
toolResult

three.min.js Command exited with code 1

assistant
thinking
I'm planning to use basic Three.js primitives—a Line with BufferGeometry, vertex colors, and additive blending—plus my own orbit controls. For the design, I'll draw three slightly different trajectories progressively using RK4 integration into a fixed point buffer with setDrawRange, adding glowing sprite points at the trail heads and coloring vertices by age to create a fading effect.

Rather than a true ring buffer, I'll keep it simple by looping the draw range and restarting once it fills, coloring by speed for visual variety. For the glow effect, since multiple line widths aren't straightforward, I'll scatter small additive sprite points along the trail to fake the glow.
→ bash {"command":"cat > index.html <<'E'\n<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>Lorenz</title>\n<style>html,body{margin:0;heig
→ browser {"action":"screenshot"}
toolResult

(no output)

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Lorenz attractor σ=10 ρ=28 β=8/3 — drag to orbit, wheel to zoom, double-click to restart","images":"attached"}

assistant
thinking
It's working but still early on. The camera looks at the origin while the world offset on z is -25, which centers the attractor since its center sits around z≈25 — that checks out. I'll let it run and check a screenshot later.
→ browser {"action":"motion"}
toolResult

Frame 1, +0ms

[Browser image supplied to model]

Frame 2, +868ms

[Browser image supplied to model]

Frame 3, +1741ms

[Browser image supplied to model]

Frame 4, +2645ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x1ec400179e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Lorenz attractor σ=10 ρ=28 β=8/3 — drag to orbit, wheel to zoom, double-click to restart","images":"attached"}

assistant
thinking
It's working but too slow since it's spiraling in the left lobe for too long. I'll bump up the step speed and iteration count, and double-check the camera centering before taking another screenshot.
→ bash {"command":"sed -i 's/N=14000,STEP=0.005,PER=6/N=30000,STEP=0.006,PER=12/' index.html"}
→ browser {"action":"reload"}
→ browser {"action":"motion"}
toolResult

(no output)

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Lorenz attractor σ=10 ρ=28 β=8/3 — drag to orbit, wheel to zoom, double-click to restart","images":"attached"}

toolResult

Frame 1, +0ms

[Browser image supplied to model]

Frame 2, +664ms

[Browser image supplied to model]

Frame 3, +1405ms

[Browser image supplied to model]

Frame 4, +2202ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x32ac0017de00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Lorenz attractor σ=10 ρ=28 β=8/3 — drag to orbit, wheel to zoom, double-click to restart","images":"attached"}

assistant
thinking
Something seems off with the attractor rendering—it looks stuck in one lobe rather than tracing the full butterfly shape. The Lorenz system starts at (1,1,1) and should spiral outward, so I'm wondering if the slow apparent motion is just due to the frame spacing being too small relative to the growth rate.

I should increase the steps per frame substantially, bumping PER to 40 with 40000 points, and double-checking that the world offset at z=-25 correctly centers things relative to the camera.
→ bash {"command":"sed -i 's/N=30000,STEP=0.006,PER=12/N=40000,STEP=0.006,PER=40/' index.html"}
→ browser {"action":"reload"}
→ browser {"action":"motion"}
toolResult

(no output)

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Lorenz attractor σ=10 ρ=28 β=8/3 — drag to orbit, wheel to zoom, double-click to restart","images":"attached"}

toolResult

Frame 1, +0ms

[Browser image supplied to model]

Frame 2, +787ms

[Browser image supplied to model]

Frame 3, +1753ms

[Browser image supplied to model]

Frame 4, +2822ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x7400171e00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Lorenz attractor σ=10 ρ=28 β=8/3 — drag to orbit, wheel to zoom, double-click to restart","images":"attached"}

assistant

I built the Lorenz attractor in `index.html` (it loads the local `three.min.js`). Three glowing trajectories start from slightly different points and draw themselves over time. The butterfly shape appears in the last of my four test frames, with colors shifting by speed. - **Controls:** dragging orbits the camera, the wheel zooms, and double-click restarts the drawing. The camera auto-rotates until you first drag. - **Looping:** once the trails are fully drawn they hold for about 4 seconds, then the animation restarts. - **Speed:** my first two speed settings drew too slowly, so I raised the drawing speed twice. The motion capture with the final setting shows the butterfly filling in over about 3 seconds. - **Testing:** the console showed only sandbox and GPU performance warnings, no errors. I didn't test drag or zoom with the browser tool, only the automatic drawing and rotation.