build-interactive-particle-trail

Emit distance-sampled pointer particles into a recycled GPU point pool with Three.js.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill build-interactive-particle-trail
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-interactive-particle-trail
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/build-interactive-particle-trail
Command: npx skills add https://github.com/MengTo/Skills --skill build-interactive-particle-trail

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three, and includes assets (resource) components.

What problem does it solve?

Timer-based particle emitters leave gaps behind fast pointer flicks and pile up bright clumps under a resting cursor. This Skill builds a cursor or touch particle trail that emits motes by distance traveled along the full segment, recycles a fixed GPU point pool, and keeps spacing consistent at any gesture speed.

Core Features & Use Cases

  • Distance-based emission: Raycast the pointer onto one interaction plane and spawn particles every 7 units along the traveled segment, capped at 14 per frame, with a 55 ms idle trickle.
  • Recycled GPU pool: A fixed 620-point ring buffer stores origin, velocity, birth time, and random seed in dynamic attributes while the vertex shader integrates flight over a 1.6-second lifetime in a single THREE.Points draw call.
  • Accessible bursts and lifecycle safety: A keyboard-focusable burst button reuses the same pool, reduced-motion mode renders a composed still, and the demo handles DPR caps, visibility pauses, resize, and full teardown.
  • Use Case: Add a pollen-lift hover effect to a nature landing page hero where pointer, pen, or touch movement sheds evenly spaced motes, with a "Release pollen" button triggering a 52-mote burst.

Quick Start

Use $build-interactive-particle-trail to add a distance-sampled cursor trail with pooled GPU particles to my landing page hero section.

Frequently Asked Questions about build-interactive-particle-trail

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a cursor particle trail with consistent spacing in Three.js?

Emit particles by distance rather than time: measure pointer travel per frame, divide by a spacing value like 7 units, and interpolate spawn points along the segment. This prevents gaps during fast flicks and clumping when the cursor rests.

How to recycle particles in a GPU point pool?

Allocate typed arrays once for origin, velocity, birth time, and random seed, then advance a ring head index on each spawn. Mark dynamic attributes for upload only after respawns and animate flight in the vertex shader from age instead of integrating on the CPU.

When should I use distance-based emission instead of a shader cursor trail?

Use distance-based emission when individual grains must react discretely to the gesture, such as pollen or dust motes. Choose a shader ribbon approach when the output should be a continuous fluid trail, and ambient particles when motion is autonomous atmosphere.

Does a WebGL particle trail support touch and reduced motion?

Yes, Pointer Events let pen and touch participate alongside mouse. Under prefers-reduced-motion, freeze particle aging and seed a designed still composition, while keeping a keyboard-accessible burst button that announces results via aria-live.

Why does my particle trail draw a diagonal line after the pointer re-enters?

The previous hit point was not reset when the pointer left or the ray missed, so re-entry interpolates from the stale exit position. Reset the stored hit on pointerleave and on raycast misses to prevent the diagonal bridge.