Skip to content

Sunil56224972/handscape--wavr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Handscape-Wavr Banner

Live Demo Stars Forks WebGL Zero Dependencies


╔═══════════════════════════════════════════════════════════════╗
β•‘                                                               β•‘
β•‘    βœ‹  Open hand   β†’   Particles explode outward              β•‘
β•‘    🀌  Pinch       β†’   Universe collapses into a singularity  β•‘
β•‘    ✊  Close fist  β†’   FIREWORKS detonate across the void     β•‘
β•‘    πŸ–οΈ  Move hand   β†’   Camera gravitates toward your palm     β•‘
β•‘                                                               β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

γ€” WHAT IS THIS 〕

tech

Handscape-Wavr is a real-time, GPU-accelerated particle universe that responds to your bare hand through a webcam.

No libraries loaded on your machine. No installs. No frameworks. Just one HTML file that turns your hand into a force of nature β€” pushing, pulling, morphing and exploding 25,000 glowing particles across a cinematic void.

The particles don't just follow your hand. They feel it. Close your fingers and watch the entire field collapse toward your palm like a black hole. Open them and matter scatters across the dark like a supernova.

This is not a demo. This is a window into something that feels alive.



γ€” ARCHITECTURE BREAKDOWN 〕

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Handscape-Wavr                           β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   WEBCAM     │───▢│  MEDIAPIPE   │───▢│  HAND LANDMARKS  β”‚  β”‚
β”‚  β”‚  getUserMediaβ”‚    β”‚ HandLandmarker    β”‚  21 keypoints     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                   β”‚             β”‚
β”‚                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚                                          β”‚  TENSION CALC    β”‚  β”‚
β”‚                                          β”‚  thumb ↔ index   β”‚  β”‚
β”‚                                          β”‚  dist β†’ 0.0-1.0  β”‚  β”‚
β”‚                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                   β”‚             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚             β”‚
β”‚  β”‚         THREE.js SCENE               β”‚β—€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚                       β”‚
β”‚  β”‚  β”‚ 25,000   β”‚   β”‚  GLSL VERTEX   β”‚   β”‚                       β”‚
β”‚  β”‚  β”‚PARTICLES │──▢│    SHADER      β”‚   β”‚                       β”‚
β”‚  β”‚  β”‚BufferGeo β”‚   β”‚  uHandTension  β”‚   β”‚                       β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚                       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

γ€” SHADER MAGIC 〕

The real brain of Handscape-Wavr lives inside two GLSL shaders β€” programs that run directly on your GPU for every single particle, every single frame.

Vertex Shader β€” Where particles go

// Each particle gets pulled toward your hand like gravity
vec3 toHand = uHandPos - pos;
float dist = length(toHand) + 0.001;
pos += normalize(toHand) * (uHandTension * 0.4 / dist);

// Tension = how closed your hand is (0.0 open β†’ 1.0 fist)
// When tension is high, particles RUSH toward your palm

Fragment Shader β€” How particles glow

// Soft circular glow β€” no textures needed, pure math
float d = dot(uv, uv);
if (d > 1.0) discard;
float alpha = smoothstep(1.0, 0.0, d);

// Color shifts to hot pink when your hand is tense
vec3 color = mix(baseColor, hot, uHandTension);

🧠 Why this matters: Running this on CPU would be ~3ms per frame. On GPU it's 0.03ms. That's 100x faster β€” the reason 25,000 particles feel buttery smooth.


γ€” PARTICLE SHAPES 〕

Shape Formula Colors Trigger
🩷 Heart x = 16sinΒ³(t) parametric curve #ff4d88 β†’ #ffe699 Button
🌸 Flower Polar: r = 0.8 + 0.25cos(6t) #18c0ff β†’ #ff88ff Button
πŸͺ Saturn Ellipsoid body + ring torus #8ad2ff β†’ #ffcc88 Button
πŸ’₯ Fireworks Spherical burst r = rand^0.35 #fff0aa β†’ #ff3399 Close fist ✊

Each shape transition uses linear interpolation (lerp) via the uMorph uniform β€” particles smoothly flow from their current positions into the new shape rather than snapping.


γ€” HAND TRACKING DEEP DIVE 〕

MediaPipe detects 21 hand landmarks at up to 60fps. Handscape-Wavr uses just 3:

Landmark 0  β†’  Wrist         (camera position target)
Landmark 4  β†’  Thumb tip     ┐
Landmark 8  β†’  Index tip     β”˜  distance = tension

Tension formula:

let tension = Math.sqrt(dx*dx + dy*dy + dz*dz);
tension = 1.0 - clamp(tension * 3.0, 0.0, 1.0);
const smoothed = lerp(current, tension, 0.25);

Auto-fireworks trigger:

if (smoothedTension > 0.85 && lastTension < 0.4) {
  setShape("fireworks"); // πŸ’₯
}

γ€” GETTING STARTED 〕

# Option 1 β€” Just open it
open index.html

# Option 2 β€” Serve locally
npx serve .
# β†’ http://localhost:3000

# Option 3 β€” GitHub Pages (free hosting)
# Push to GitHub β†’ Settings β†’ Pages β†’ main β†’ Save
# Live at: https://Sunil56224972.github.io/Handscape-Wavr

πŸ“Έ Allow camera when prompted. Best in Chrome or Edge. Hand tracking runs 100% locally β€” no data leaves your device.


γ€” TECH STACK 〕

Layer Technology Why
🎨 Rendering Three.js r160 + WebGL GPU-accelerated 3D scene
βœ‹ Hand Tracking MediaPipe Tasks Vision 0.10.14 Best-in-class real-time hand AI
⚑ Particles Custom GLSL Vertex + Fragment Shaders Raw GPU speed
πŸŽ₯ Camera Web APIs getUserMedia Native browser, no plugins
πŸ“¦ Dependencies Zero (CDN only) Clone and open, nothing to install

γ€” PERFORMANCE 〕

Particles rendered per frame  β†’  25,000
Target framerate               β†’  60 FPS
Hand detection latency         β†’  ~16ms (1 frame)
GPU draw calls per frame       β†’  1 (single Points mesh)
CPU usage (idle hand)          β†’  < 5%
Total file size                β†’  1 HTML file (~12KB)

γ€” FILE STRUCTURE 〕

Handscape-Wavr/
β”‚
└── index.html   ← The entire universe. One file. That's it.

footer

About

πŸ–οΈ Control cinematic particle animations with your hand gestures using MediaPipe + Three.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages