Skill library

Agent skill Web motion

WebGL 3D Object

Use spatial graphics, scenes or materials to support a web experience.

  • 3D / WebGL

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/webgl-3d-object --skill webgl-3d-object --agent claude-code --yes

Check this file in your project.claude/skills/webgl-3d-object/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/webgl-3d-object --skill webgl-3d-object

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Prepare a bounded canvas slot, an original poster, and a compatible Three.js package. The isolated browser example used three@0.186.0 with a WebGL 2 context.

View operation manual

What this skill helps with

  • Use spatial graphics, scenes or materials to support a web experience.

Good for

  • 3D on the web
Publisher
Meng To
Runtime
three@0.186.0 · WebGL 2
Bundled example
The installed demo wrapper references shared runtime files outside the Skill directory. Use demo/preview.jpg for composition and the Three.js recipe in SKILL.md for implementation.
Skill name
webgl-3d-object
Repository
MengTo/Skills

Common pitfall

Avoid this prompt

Resize the canvas in CSS alone and keep its animation loop running after navigation.

The render buffer and projection can diverge from the layout. An orphaned loop continues using a renderer that is no longer needed.

Use these steps

  1. Inspect the demo and target
  2. Apply the runtime recipe
  3. Verify the browser behavior

Project walkthrough

Render a faceted original specimen with real geometry, directional light, and a stable mobile fallback.

Render a faceted original specimen with real geometry, directional light, and a stable mobile fallback.

  1. Inspect the demo and target

    The installed demo wrapper references shared runtime files outside the Skill directory. Use demo/preview.jpg for composition and the Three.js recipe in SKILL.md for implementation.

    Prompt · Step 1
    Use WebGL 3D Object on [my sandstone specimen hero]. Open demo/preview.jpg for composition and read the Three.js Object Recipe in SKILL.md. Identify the real product copy, a canvas slot with reserved dimensions, and an original poster. Choose a faceted icosahedron and mark the front key, fill, and optional rim positions.
  2. Apply the runtime recipe

    Render a faceted original specimen with real geometry, directional light, and a stable mobile fallback.

    Prompt · Step 2
    Create an IcosahedronGeometry with a MeshStandardMaterial, flatShading, roughness and low metalness for this specimen. Use a PerspectiveCamera with a directional key and dim ambient fill. Allow slow rotation and small Y bobbing, with a still render in reduced motion. Set the render buffer and camera aspect from the canvas container, cap DPR at 1.75 for this fixture, and update the projection on resize. Keep a poster on initialization failure. On unmount cancel the frame loop, remove resize listeners, and dispose of owned geometry, materials, shadow resources and renderer.
  3. Verify the browser behavior

    A responsive WebGL render has a current camera aspect and a capped device pixel ratio.

    • A responsive WebGL render has a current camera aspect and a capped device pixel ratio.
    • Reduced motion renders still, and teardown stops the frame counter.
    Prompt · Step 3
    At desktop and mobile widths, confirm there are real draw calls, the silhouette keeps its proportions, and the key light defines the faces. Reload with reduced motion, verify a single still frame before resizing, and confirm the product link still works. Unmount the section, check the frame counter stops, and mount it again with exactly one renderer.

Implementation lookup

Find the actual behavior in the recipe and check it in your browser.

Tune the documented controlsInputs
Command or reference
IcosahedronGeometry · MeshStandardMaterial · PerspectiveCamera · setSize · dispose
Examples
A responsive WebGL render has a current camera aspect and a capped device pixel ratio.
Check the fallback and lifecycleVerify
Command or reference
Reload and recheck
Examples
Reduced motion renders still, and teardown stops the frame counter.

FAQ

Can I run the installed demo as a self-contained Three.js project?

The installed wrapper refers to publisher runtime files that are absent from the installed Skill. Use its bundled preview for the visual reference and the SKILL.md recipe to build a renderer in your own project.

What does the installed demo include?

The installed demo wrapper references shared runtime files outside the Skill directory. Use demo/preview.jpg for composition and the Three.js recipe in SKILL.md for implementation.