Skip to content

yogender-ai/Fun-Particle-feedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

85 Commits
ย 
ย 

Repository files navigation

Quantum Flux Quantum Flux animated headline



Launch demo ย  Quick start ย  Feedback



Quantum Flux GitHub card



GitHub stars GitHub forks GitHub issues Last commit Profile views

โ•”โ•โ•โ•โ•โ•โ•โ•โ• โŸจ QUICK NAV โŸฉ โ•โ•โ•โ•โ•โ•โ•โ•โ•—

What How Stack Play Build Bench Star

โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐ŸŽฌ Watch The Cosmos Bend

Quantum Flux demo



Swarm mode Heart mode Saturn mode Fireworks mode Battle mode

โ†‘ click any mode to launch directly into it โ†‘


๐Ÿช The Vision

    .  *      โœฆ       .         *  .
   .          .       โœฆ        .
โœฆ . * .                 . * โœฆ . *
          .  YOU  .              *
.   โœฆ              โœฆ       .
.       *       โœฆ      .   *
   โœฆ         .  *               .
   .          .       โœฆ        .

Not a game. Not a demo.

An experience.

Quantum Flux dissolves the barrier between you and the screen. Your hand becomes a celestial body. Your gestures, gravitational law. Your webcam, the lens of a god.

Built on a Rust-powered physics core compiled to WebAssembly, it runs 8,192 particles at 60+ FPS. AI vision tracks 21 hand landmarks in real time, translating motion into mathematics, and mathematics into magic.

Cosmic motion
+ ๐ŸŒŒ 8,192 particles
+ โšก 60+ FPS
+ ๐Ÿค– AI hand tracking
+ ๐Ÿฆ€ Rust + WASM core
+ ๐ŸŽต Audio reactive
+ ๐ŸŽจ 6 morph shapes

โš™๏ธ How It Works

flowchart LR
    subgraph Input
    A([๐Ÿ“น Webcam]):::cam
    end

    subgraph AI["๐Ÿง  AI Layer"]
    B[MediaPipe Neural Net]:::ai
    C[21 Landmarks per Hand]:::ai
    end

    subgraph Rust["๐Ÿฆ€ Rust Core / WASM"]
    D[Spatial Hash]:::rust
    E[N-Body Solver]:::rust
    F[Verlet Integration]:::rust
    end

    subgraph Render["๐ŸŽจ GPU Render"]
    G[Three.js Scene]:::gl
    H[Custom Shaders]:::gl
    I([๐Ÿ’ป 60+ FPS]):::result
    end

    A ==>|raw frames| B
    B ==>|inference| C
    C ==>|x, y, z coords| D
    D ==>|neighbors| E
    E ==>|forces| F
    F ==>|positions| G
    G ==>|draw calls| H
    H ==> I

    classDef cam fill:#1a1a2e,stroke:#5eead4,color:#5eead4,stroke-width:2px
    classDef ai fill:#1a1a2e,stroke:#fbbf24,color:#fbbf24,stroke-width:2px
    classDef rust fill:#1a1a2e,stroke:#CE422B,color:#ff8266,stroke-width:2px
    classDef gl fill:#1a1a2e,stroke:#a78bfa,color:#c4b5fd,stroke-width:2px
    classDef result fill:#0d1117,stroke:#22c55e,color:#22c55e,stroke-width:3px
Loading

๐Ÿ› ๏ธ The Arsenal

Rust WASM Three.js WebGL MediaPipe Cloudflare
1.75+ Core r160 2.0 Hands Pages

๐ŸŽฎ Control Grimoire

Master these gestures and bend reality to your will.

Gesture Mode Effect
โ˜๏ธ Index Finger Swarm Particles orbit your fingertip like moons around a planet
๐Ÿค Pinch Supernova Releases a chaotic burst of color and energy
๐Ÿ–๏ธ Open Palm Kamehameha Charges an energy beam
โœŠ Fist Fire Unleashes the charged beam in a torrent of light
๐Ÿ™Œ Two Hands Battle Two opposing gravity wells fight for cosmic dominance
๐ŸŽต Music Audio Particles dance to bass, treble, and rhythm

๐Ÿชž Shape Library

๐ŸŒŒ Swarm โค๏ธ Heart ๐Ÿช Saturn ๐ŸŒธ Flower
๐ŸŽ† Fireworks โš”๏ธ Battle ๐Ÿ›ก๏ธ Survival ๐ŸŽต Audio Reactive

๐Ÿš€ Quick Start

๐ŸŒ Just Want To Play?

# One link. Zero setup.
open https://particle-gravity-fun.pages.dev/

Allow webcam โ†’ wave hands โ†’ become gravity.

๐Ÿ› ๏ธ Want To Hack On It?

# Clone
git clone https://github.com/yogender-ai/Particle-Gravity-Fun.git
cd Particle-Gravity-Fun

# Install
npm install

# Build WASM core
wasm-pack build --target web --release

# Launch
npm run dev

๐Ÿ“Š Benchmarks

PARTICLE COUNT
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  8,192

FRAME RATE (avg)
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘  62 FPS

HAND TRACKING LATENCY
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  18ms

WASM EXECUTION (per frame)
โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  2.4ms

BUNDLE SIZE (gzipped)
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  280 KB

COLD START TIME
โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘  1.8s

๐Ÿ“ˆ Performance Across Devices

Device FPS Particles Notes
๐Ÿ–ฅ๏ธ M1 MacBook Pro 120 16,384 Buttery smooth
๐Ÿ’ป Ryzen 5 + RTX 3060 144 16,384 Maxed out
๐Ÿ’ผ Intel i5 + Iris Xe 60 8,192 Default config
๐Ÿ“ฑ iPhone 13 60 4,096 Auto-scaled
๐Ÿ“ฑ Pixel 6 58 4,096 Auto-scaled
๐Ÿฅ” 2015 Chromebook 30 2,048 Still magical

๐Ÿ—๏ธ Project Architecture

quantum-flux/
โ”‚
โ”œโ”€โ”€ src-rust/                   # Rust โ†’ WASM core
โ”‚   โ”œโ”€โ”€ lib.rs                  # WASM entry & bindings
โ”‚   โ”œโ”€โ”€ physics/
โ”‚   โ”‚   โ”œโ”€โ”€ solver.rs           # N-body gravity solver
โ”‚   โ”‚   โ”œโ”€โ”€ verlet.rs           # Verlet integration
โ”‚   โ”‚   โ””โ”€โ”€ spatial_hash.rs     # O(n) neighbor lookups
โ”‚   โ”œโ”€โ”€ particle.rs             # Particle struct & lifecycle
โ”‚   โ””โ”€โ”€ morphs/
โ”‚       โ”œโ”€โ”€ heart.rs            # Heart formation
โ”‚       โ”œโ”€โ”€ saturn.rs           # Orbital rings
โ”‚       โ””โ”€โ”€ flower.rs           # Fibonacci spiral
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.js                 # Entry point
โ”‚   โ”œโ”€โ”€ scene.js                # Three.js scene setup
โ”‚   โ”œโ”€โ”€ shaders/
โ”‚   โ”‚   โ”œโ”€โ”€ particle.vert       # Vertex shader
โ”‚   โ”‚   โ””โ”€โ”€ particle.frag       # Fragment glow & color
โ”‚   โ”œโ”€โ”€ tracking/
โ”‚   โ”‚   โ”œโ”€โ”€ mediapipe.js        # AI wrapper
โ”‚   โ”‚   โ””โ”€โ”€ gestures.js         # Gesture recognition
โ”‚   โ”œโ”€โ”€ audio/
โ”‚   โ”‚   โ””โ”€โ”€ analyzer.js         # FFT music reactor
โ”‚   โ””โ”€โ”€ ui/
โ”‚       โ”œโ”€โ”€ hud.js              # Score & stats overlay
โ”‚       โ””โ”€โ”€ controls.js         # Mode switcher
โ”‚
โ”œโ”€โ”€ public/                     # Static assets
โ”œโ”€โ”€ feedback.html               # Feedback page
โ”œโ”€โ”€ README.md                   # You are here
โ””โ”€โ”€ wrangler.toml               # Cloudflare config

๐Ÿ—บ๏ธ Roadmap

   โ”Œโ”€ โœ… v1.0 โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 8K particles + hand tracking
   โ”‚
   โ”œโ”€ โœ… v2.0 โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Battle mode + audio reactive
   โ”‚
   โ”œโ”€ โœ… v2.1 โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Kamehameha + survival mode  โ—€โ”€โ”€ you are here
   โ”‚
   โ”œโ”€ ๐Ÿ”„ v2.2 โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Multiplayer cosmos (WebRTC)
   โ”‚
   โ”œโ”€ ๐Ÿ”ฎ v3.0 โ”€โ”€โ”€โ”€โ”€โ”€โ”€ VR/AR support (WebXR)
   โ”‚
   โ””โ”€ ๐ŸŒ  v4.0 โ”€โ”€โ”€โ”€โ”€โ”€โ”€ AI-generated particle behaviors

๐Ÿ’ฌ Feedback โ€” Speak Into The Void

Your voice shapes the next iteration.

๐Ÿ’ญ Have an idea? ๐Ÿ› Found a bug? โญ Loved it?
Open Discussion Report Issue Star the repo

โญ Show Some Love

If Quantum Flux made you smile or spend a Saturday afternoon bending particles, a star keeps the cosmos expanding.


Star the repo

๐Ÿค Contributing

# Fork the cosmos
git checkout -b feature/cosmic-idea

# Channel the muse
git commit -m "Add black hole mode"

# Push to the void
git push origin feature/cosmic-idea

Looking for help with:

  • ๐ŸŽจ New morph shapes
  • ๐ŸŽต Better audio analysis
  • ๐Ÿ“ฑ Mobile gesture mapping
  • ๐ŸŒ i18n / translations
  • ๐Ÿ“š Tutorials and blog posts
  • ๐ŸŽฌ Demo video creation

๐Ÿ“œ License & Acknowledgements

MIT License โ€” fork it, ship it, remix it.

Standing on the shoulders of giants:


QUANTUM FLUX v2.1 ยท Rust โค๏ธ WASM โค๏ธ WebGL ยท Made in the cosmos

Back to top โ†‘

About

An interactive particle gravity experiment built with WebGL, Three.js, and WebAssembly (WASM), exploring real-time physics and creative coding in the browser.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors