跳到正文

AkbarSheikh-debug

wondersnap

Gesture-controlled 3D models made of 200k glowing GPU particles. MediaPipe hand tracking + hand-written WebGL2, runs in the browser.

README 已保存到本站,可直接阅读

Documentation snapshot

README 快照

这篇是英文原文

下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。

本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。

WonderSnap

Gesture-controlled 3D models made of glowing light particles, running entirely in your browser.

Snap your fingers in front of your webcam and up to 250,000 GPU particles swirl into existence. Make a fist and they form the Eiffel Tower, a beating heart or a V8 engine. Open your hand and the model morphs into the next one, or explodes into a labelled diagram of every part. No mouse, no controller, no install beyond Node.js.

图片:WonderSnap showing a beating human heart made of particles

Quick start

You need Node.js 18 or newer and a webcam (optional: everything also works with the mouse and keyboard).

git clone https://github.com/AkbarSheikh-debug/wondersnap.git
cd wondersnap
npm install
npm start

Then open http://localhost:5173 in Chrome or Edge and click Start with camera, or Continue without camera to drive it with the on-screen buttons and keyboard.

The browser only allows camera access on localhost or https, which is why the app comes with its own tiny local server. To use a different port: npm start -- 8080.

How it works

LayerWhat it does
Hand trackingMediaPipe Hand Landmarker tracks up to two hands (21 landmarks each) from the webcam, fully on-device
Gesture recognitionCustom classifiers turn landmarks into poses (fist, open, point, pinch, peace), a finger-snap detector, hand twist/tilt and two-hand zoom, fed through a debouncer and a state machine
Particle engineA hand-written WebGL2 renderer. Particle physics runs on the GPU with transform feedback: no Three.js, no game engine, no framework
Models33 procedural models built from real measurements and sampled into point clouds, with named parts that can explode, glow and be pulled out
ServerA zero-dependency Node.js static server (server.mjs)

Nothing is sent anywhere: the video never leaves your machine.

Gestures

GestureWhat it does
🫰 SnapSummon the particles, or dissolve the current model
✊ FistForm the wonder, organ or machine
✋ Open handWonders morph to the next one. Organs, engines and vehicles explode: how far you open your hand sets how far the parts fly apart, and closing it puts them back together
🔄 Twist / raise your handTurn and tilt the formed model
☝️ PointHold your finger on a part to select it. It glows, and a card explains what it does
🤏 PinchPull the selected part out toward you; pinch again to put it back
🙌 Two handsMove them apart or together to zoom
✌️ PeaceJump to the next model

Keyboard and mouse

KeyAction
SpaceSnap
F / O / VFist / open hand / peace sign
← →Previous / next model
E, ↑ ↓, mouse wheelExplode amount
+ - 0, ctrl + wheelZoom
CCamera on/off
LPart labels
RAuto-rotate
GHand rotation on/off
XCut-away cross-section (, and . nudge the plane)
QQuiz mode
MVoice commands and read-aloud
KRecord a video
DPlay the demo
I / EscDescribe / deselect the selected part
HHelp

Click a part to select it, drag to rotate.

Features

  • Beating heart and breathing lungs. The heart contracts in a lub-dub rhythm at 72 bpm, the lungs inflate every 4.5 s, and pulses of light travel through them like blood or air.
  • Exploded views with named parts. Every part has a leader-line label saying what it does.
  • Quiz mode. “Find: Hippocampus”: point at (or click) the right part. Five questions, with a score.
  • Voice control. Say “show me the heart”, “open it up”, “where is the right atrium”, “zoom in”, “quiz” and more. Parts are read aloud with speech synthesis (Chrome or Edge).
  • Cut-away. A cutting plane follows your hand and reveals a glowing cross-section.
  • Recording. Save a WebM video of the scene.

Models

CategoryModels
Wonders (11)Turtle Tower, Eiffel Tower, Statue of Liberty, Burj Khalifa, Great Pyramid, Colosseum, Leaning Tower of Pisa, Taj Mahal, Big Ben, Christ the Redeemer, Sydney Opera House
Anatomy (10)Brain, beating Heart, Kidney, breathing Lungs, Eye, Ear, Tooth, Skull, Skeleton, Human Body (skin, organs, nerves, arteries, veins, skeleton)
Biology (2)DNA double helix that unzips, Animal cell
Engines (4)Inline-4, Supercharged HEMI V8, Turbofan jet, 9-cylinder radial
Vehicles (4)Sports car, Motorcycle, Airliner, Saturn V (with stage separation)
Machines (2)Mechanical wristwatch, EV battery pack (280 cells, busbars, cooling, BMS)

URL options

OptionEffect
?n=250000Particle count
?model=12Start on a given model
?autostart=camera / ?autostart=nocameraSkip the start screen
?trails=0Turn off particle trails
?dpr=1Force the device pixel ratio (useful on slower GPUs)

Tests

36 end-to-end and unit tests with Playwright, driving the real app with synthetic hands on a deterministic clock.

npx playwright install chromium   # one time
npm test
SpecCovers
app.spec.jsThe full gesture story, every model, explode/contract, keyboard, wheel, tabs, demo, phone layout, hand twist and tilt
features.spec.jsHeartbeat and breathing, two-hand zoom, point-to-pick, pinch-to-pull, quiz, voice commands, cut-away, video recording
camera.spec.jsReal getUserMedia to MediaPipe on Chromium’s fake webcam, plus the camera-denied fallback
gpu.spec.jsThe GPU physics shader matches its CPU twin to ~1e-7 in every mode
logic.spec.jsPose classifiers, snap detector, debouncer, state machine, controller, voice-command parser
models.spec.jsEvery model is deterministic, finite and fast, with real measurements and correctly exploding parts

Project structure

index.html, styles.css     page and styles
server.mjs                 zero-dependency static server
models/                    MediaPipe hand landmark model
src/app.js                 render loop, explode, zoom, picking, quiz, cut-away, HUD, labels, demo
src/hands.js               webcam + MediaPipe Hand Landmarker
src/features.js            voice commands, read-aloud, video recorder
src/gl/                    WebGL2 shaders and renderer (transform-feedback physics)
src/logic/                 gestures, state machine, controller, CPU physics twin
src/lib/                   vector math, samplers, procedural shapes
src/models/                wonders, anatomy, biology, engines, vehicles, machines
tests/                     Playwright specs

Troubleshooting

  • Camera doesn’t start: open the app via http://localhost:5173, not by double-clicking index.html, and allow camera access when the browser asks.
  • Hand tracking never loads: run npm install first; the tracking runtime is served from node_modules.
  • Low frame rate: try http://localhost:5173/?n=100000&dpr=1.
  • Port already in use: npm start -- 8080 and open http://localhost:8080.

License

MIT © 2026 Akbar Sheikh

Official distribution

获取与安装

暂未发现可确认的官方软件包地址

当前 README 快照没有出现 npm、PyPI、Crates.io、pub.dev 等官方包页链接。本站不会根据仓库名称猜测下载地址。

本站不托管项目文件;需要安装时,请以项目维护者发布的官方文档为准。

使用前核验

本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。