Guides / Websites

A 3D head hero that bursts into dots, built with Claude Code: 6 prompts, one file per step (try every step live)

A 3D head that bursts into dots in 6 Claude Code steps: layout, plaster, chrome, Bayer dither, 90,000-point burst, cobalt. All 6 prompts + a live page per step.

You may have seen this kind of homepage on Instagram: a 3D head in the middle that breaks into dots when the mouse passes over it, then slowly pulls itself back together. It looks hard, but taken apart it is six steps: lay out the page, drop in a 3D head, make it chrome, add a dither shader, rebuild it from tens of thousands of particles, then change the colours.
The page in this guide was made by a fresh Claude Code agent in one conversation: six turns, one step each, every step saved as its own file, plus a seventh turn that only changed one headline. We didn't change a line of its code. The brand "Dotform" is fictional; the 3D head is the free head scan from the three.js examples (Lee Perry-Smith, CC BY 3.0). You get: all six prompts in full (swap the [] parts for yours), a real screenshot and a playable page for every step, and what Claude Code actually did at each one.

01The result: a cobalt page with a white dot head that bursts on hover

Final Dotform hero: cobalt background, big white headlines, a 3D head of white dots with brighter chrome streaks.
Final index.html: cobalt, white text, a white dot head. Big lit dots and small dark dots keep the chrome streaks.

It is a desktop hero: a nav bar at the top, a two-line headline top left and another bottom right, a few small monospace labels and a short intro bottom left. The star is the head in the middle: 90,000 points sampled from the model's surface, slowly turning. Move the mouse onto the head and the points in that area are pushed away into a cloud; move it off and they spring back into place and re-form the head.

We kept the page from every one of the six steps, and you can open each one. Start with the final version:

  1. Open the final version and wait for the head to appear (the first time takes a few seconds while the model and three.js download).
  2. Move the mouse slowly over the top of the head and the face: the dots get pushed away and come back once you move on.
  3. Hold the mouse button and drag left or right to turn the head yourself; let go and it carries on turning slowly.
  4. Then look at each step's page below to see how the head was built up layer by layer.

02Before you start: set up a folder

All six prompts go into the same conversation, one after another. Put the files it needs in place first so Claude Code doesn't have to hunt for them online:

  1. Make an empty folder with two folders inside: models/ and fonts/.
  2. Download LeePerrySmith.glb from the three.js examples folder on GitHub (link below) into models/. It is a free head scan under CC BY 3.0: you can use it, but you must credit it.
  3. Put three fonts in fonts/: Inter, a monospace font (we used JetBrains Mono) and a bold Chinese font (we used Noto Sans TC). You can skip this; Claude Code will fall back to system fonts.
  4. Open Claude Code in that folder, paste prompt 1, add the technical notes below after it and send.
  5. After each step, run npx serve (or any local server) in the folder, open that step's file in the browser, then paste the next prompt.
Technical notes (optional, paste with prompt 1; swap the [] parts for yours)
(Technical notes, paste them together with prompt 1)
- Work only inside this folder. models/ holds [LeePerrySmith.glb] and fonts/ holds [Inter, JetBrains Mono, Noto Sans TC]. Load these fonts with @font-face and relative paths; no Google Fonts.
- Load three.js from the CDN with an importmap: https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js and https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/ . Everything else (HTML, CSS, JS, GLSL) inline in the one file, relative paths only.
- Target a [1600×900] desktop viewport.
- Each step is its own file; for the next step copy the previous file and change the copy, never the old one.
- When done, test it yourself in headless Chrome on a local server: no console errors, take screenshots (also after dragging or hovering where the step has interaction) and look at them before you report.

These are not design instructions. They only tell it where the files are, where three.js comes from, and "save every step as a new file and leave the old ones alone". That last line matters most: all six files stay, so if a step breaks you go back one, and you can compare them. For the video we also added some recording settings (a frame-by-frame clock, no custom cursor); you don't need those.

03Step 1: layout first, with a slot for the head

Prompt 1 (our original, translated; swap the [] parts for yours)
Build me the hero section of a website homepage (one HTML file, save it as step1.html). This step is layout only, no 3D yet.

The brand is "[Dotform]" (a fictional [design AI studio]).
- A thin nav bar at the top: brand name on the left, "[Product · Resources · Blog · Pricing]" in the middle, an outlined "[Log in]" button on the right.
- A huge two-line headline top left, "[A new / way of thinking]", and another huge two-line headline bottom right, "[Design / keeps evolving]". Very big, very tight.
- A few tiny monospace labels scattered over the page, e.g. "[0.002s / neural response]", "[01 / intuitive computing]", "[24° / view angle]", and a short two-to-three-line intro in small type bottom left.
- Leave a large grey box just right of centre, almost the full height of the hero, for a 3D head later.
- Style: black on white, Inter with Noto Sans TC, a Swiss grid. Make the whole thing look like a wireframe in a design tool: very thin grey column lines, a thin outline and a size label on every element, so it clearly reads as the "layout first" stage.
Step 1 wireframe: black on white, a 12-column grid, both headlines and a crossed grey box marked 3D HEAD 622 × 742.
step1.html: a design-tool wireframe with an outline and a size on every element (head slot 622 × 742).

Claude Code made a step1.html with column numbers 01 to 12 across the top, grey lines for a 12-column grid, a small name at the top left of every element (H1 / headline A, TAG / 01, IMG / 3D head) and its size at the bottom right. At the very bottom there is even a line "FRAME / HERO · 1600 × 822 · 12 COL · STEP 01". It added all those size labels on its own.

04Step 2: drop in the 3D head, plaster first

Prompt 2 (same conversation)
Great. Next step, save as step2.html: replace the grey box in the middle with a 3D head (models/[LeePerrySmith.glb]). Start with a plain light-grey material, like a plaster bust, with soft lighting. The head should be big, almost the full height of the hero, slightly right of centre, with the two headlines overlapping it on either side. Dragging with the mouse rotates the head (it slowly turns back when you let go), and when the mouse moves over the page the head looks towards it a little. Keep the wireframe grid lines and outlines for now, but lighter.
Step 2: a light-grey plaster-like 3D head in profile inside the wireframe, headlines on both sides, grid lighter.
step2.html while dragging: the plaster head turned to profile. The grid stays, just lighter.

It loads the model with three.js's GLTFLoader, gives it a very matte light-grey material (almost no shine) and adds a soft key light with shadows. Dragging turns the head and it slowly turns back to the front when you let go; when the mouse simply moves over the page, the head turns slightly towards it.

05Step 3: make it chrome and let it turn by itself

Prompt 3 (same conversation)
Next step, save as step3.html: give the head a chrome look, like liquid mirror silver, with clear black-and-white reflection bands (for the environment map use a studio lighting environment generated in code, no external HDR file). Add a head-turn animation too: the head slowly turns from profile to the front, then on to the other side, looping; it pauses while dragging and carries on after you let go. Remove the wireframe grid lines and outlines so it becomes a clean page.
Step 3: a clean white page; the head is mirror chrome with big black-and-white reflection bands.
step3.html: liquid silver. The bands reflect a small photo studio it built in code.

Whether chrome looks right depends almost entirely on what it reflects. The prompt said no external HDR file, so Claude Code built a small studio in code: a few tall white softboxes around the head and a long strip light above it, then turned that scene into an environment map. The material is fully metallic with very low roughness, so those softboxes become the clear black-and-white bands on the face.

The head turns from profile to the front and on to the other side, looping; it pauses while you drag and carries on after you let go. The wireframe grid and outlines are all gone at this step, leaving a clean homepage.

06Step 4: add a dither shader

Prompt 4 (same conversation; swap the [] parts for yours)
Next step, save as step4.html: add a dither shader that draws the head as halftone dots: use Bayer ordered dithering to turn light and shade into square dots on a grid, with [neon yellow-green #d4ff3a] for the lights and [dark green #1d3a12] for the shadows. Keep the background white and leave the text untouched. The head keeps turning, the dots are about [4–5] px so you can see each one, and the chrome reflection bands should still show through the density of the dots.
Step 4: the head as square halftone dots, neon yellow-green lights and dark green shadows, text still black on white.
step4.html: Bayer dither. The reflection bands show as strips of denser bright-green dots.

It draws the chrome head as before, then adds a post-processing pass on top: the frame is cut into small square cells, each cell reads the head's brightness once and compares it with an 8×8 Bayer threshold table; brighter than the threshold gets neon yellow-green, darker gets dark green. Each cell is about 4.5 to 5 px including a 1 px gap, so you can see every square dot.

Where there is no head the layer is fully transparent and the white page shows through. The headlines and labels are normal HTML text, not part of the 3D canvas, so "leave the text untouched" comes for free.

07Step 5: tens of thousands of points that burst when the mouse comes close

Prompt 5 (same conversation; swap the [] parts for yours)
Next step, save as step5.html: add a particle burst. Build the head from tens of thousands of small points (sampled from the model's surface), with point size following the lighting (lit points big, dark points small), keeping the [yellow-green tones on white]. Where the mouse comes close, the points are pushed outward and burst into a cloud; when the mouse leaves, they slowly fly back and re-form the head. The head keeps slowly turning.
Step 5: the head as a cloud of green points on white, with a round hole pushed into the face by the mouse.
step5.html, mouse on the face: points in that circle are pushed away and drift into a cloud.

This step changes the approach: instead of drawing a solid head, it uses three.js's MeshSurfaceSampler to sample 90,000 points from the model's surface. Each point gets its brightness from the same studio as step 3: lit points are big (about 5 px) and dark ones small (about 1.6 px), so the chrome reflection bands still read.

Points within roughly 150 px of the mouse are pushed outward, each with a slightly random strength and direction, so they burst into a cloud rather than a neat ring. Every point behaves as if tied to its spot by a soft spring: once the mouse leaves, it is slowly pulled back to its place on the head, which keeps turning the whole time.

08Step 6: cobalt background, white dot head (final version)

Prompt 6 (same conversation; swap the [] parts for yours)
Final version, save as index.html: switch the whole hero to a [cobalt background #1238ff] with all text in white; the head becomes a white dotted particle head, like halftone print / ASCII, with a little of the chrome reflection banding in the brightness of the dots. When the mouse passes over, the dots in that area burst into a cloud and then slowly come back together; the head keeps slowly turning. Keep the nav bar, small labels and bottom-left intro, and put a tiny [neon yellow-green] square in front of every small label.
Final version on hover: the top of the white dot head bursts into a big cloud of dots on cobalt.
index.html, mouse over the head: the white dots burst into a cloud and re-form a few seconds later.

The last step adds almost no new code: the particles, burst and springs are the same as step 5, and Claude Code mostly changed the colours. The background became #1238ff and all text white; dark dots are a pale blue just above the background, mid-tones a lighter blue and lit dots white, so the dots look like halftone printed on blue paper. Every small label got a 6 px neon yellow-green square in front, the only touch of yellow-green on the page.

09Turn 7: change one headline only

After the six steps we noticed the bottom-right headline had been written as 「設計, / 持續進化」, with a comma hanging at the end of the first line, which looks bad in two lines of huge type. So we sent one more line in the same conversation and asked it to fix all six files. Prompt 1 above is already the fixed version, so you won't hit this if you paste it as is.

Turn 7 (what we actually sent)
Change the bottom-right headline in all six files to two lines [讓設計 / 持續進化] with no comma; keep everything else.

It changed the bottom-right headline in all six files to 「讓設計 / 持續進化」 and updated the font preload string to match; nothing else changed.

10Make it your own brand

  1. Brand and copy: change the brand name, nav, both headlines and the labels in prompt 1. Short headline lines look best, and never end a line with a comma.
  2. Colours: the yellow-green and dark green in prompts 4 and 5 and the cobalt in prompt 6 can all change. For the final version a very saturated background with white dots shows the effect best.
  3. Model: swap in another .glb model (an animal, a product, your logo in 3D) and replace "head" with your object in every prompt. Check the licence before you use someone else's model.
  4. Dot size: raise the "4–5 px" in prompt 4 for a bolder dot look, lower it for a finer one.
  5. Particle count: 90,000 points can stutter on an older laptop. If it does, say "halve the number of points, change nothing else".

11Good to know

  1. All six pages were written by Claude Code and we didn't change the code; we only cut the Chinese font down to the characters on screen so the demo loads faster (the whole demo folder is about 1.8 MB).
  2. Every run is different. With the same prompts, your layout details, dot pattern and size labels may not match ours.
  3. It needs a connection: three.js loads from the jsDelivr CDN. Double-clicking an HTML file usually fails to load the model; open it through a local server.
  4. The demo pages are desktop layouts and crowd together on a phone; 90,000 particles may also run slowly on older computers.
  5. The 3D head is "Infinite, 3D Head Scan" by Lee Perry-Smith (Infinite Realities), CC BY 3.0, from the three.js examples. If you use it on your site, credit it on the page.
  6. "Dotform" and the intro text and numbers on the page are a fictional demo. The monitor and room in the video are ChatGPT-generated background images; the page on the screen is a real recording of these six files.

Sources

Related guides