๐Ÿ”ฅ Fire & Ice — Magic Hand Particle System ❄️ | Pure Python

๐Ÿงช Project Showcase · 2026

Fire & Ice

Magic Hand Particle System

// Real-time · Hand Tracking · Pure Python · Zero Game Engine

๐Ÿ”ฅLEFT HAND = FIRE
❄️RIGHT HAND = ICE
BOTH = FUSION
๐Ÿ Python 3.8+ OpenCV 4.7+ MediaPipe 0.10.8 NumPy MIT License
5000
Particles
21
Hand Landmarks
60+
FPS Target
0
Game Engines

๐Ÿ“– The Story

What happens when you bring your hands in front of a camera and suddenly the room fills with blazing fire particles and shimmering ice crystals? That's exactly what this project does — and it does it with pure Python, no game engine, no Unity, no Unreal Engine.

Built with MediaPipe's hand landmark detection and OpenCV rendering, this project tracks your hands in real-time and spawns 5,000 physics-driven particles around them. Your left hand summons fire. Your right hand conjures ice. Bring them close together and watch the fusion explosion light up your screen.

Point your index finger and you enter Air Drawing mode — trails of glowing light follow your fingertip and persist on screen. Close your fist and particles explode outward dramatically. This is computer vision magic, built by one person, from scratch.

What Makes This Special

๐Ÿ”ฅ
FIRE MODE
Left hand summons 5,000 blazing particles with upward drift physics. Particles orbit your palm in a fiery spiral with real-time glow compositing.
❄️
ICE MODE
Right hand conjures shimmering crystalline particles with lateral shimmer physics. Each ice particle has a unique drift angle and twinkle cycle.
FUSION MODE
Bring both hands within 180px of each other and trigger an epic dual-spiral collision — fire and ice particles interleave in a vortex.
✍️
AIR DRAWING
Point your index finger to activate writing mode. A glowing trail follows your fingertip and persists on the canvas with beautiful fade-out.
๐Ÿ’ฅ
FIST EXPLODE
Close your fist and all nearby particles blast outward dramatically. Physics-accurate radial force applied to every particle simultaneously.
๐ŸŒŒ
STAR FIELD
300 twinkling ambient stars fill the background. Each star has its own twinkle speed and phase. Toggle with B.
๐ŸŽจ
3 LIVE THEMES
Switch between 3 colour palettes on the fly using keys 1, 2, 3. Changes the particle colour scheme instantly without restarting.
⏱️
LIVE HUD
Real-time FPS counter, session timer, and per-hand gesture labels overlaid on screen so you always know exactly what mode each hand is in.
๐Ÿ“ธ
SCREENSHOTS
Press S to save any frame. Auto-saved to the screenshots/ folder with a timestamp filename.
FULLSCREEN
Press F for instant fullscreen mode. The particle system scales to fill your entire display for maximum visual impact.

๐Ÿ› ️ How It Works

๐Ÿ“ท
WEBCAM CAPTURE
Grabs 1280×720 frames using cv2.VideoCapture. Flipped horizontally so your left hand appears on the left.
๐Ÿค–
MEDIAPIPE HANDS
Detects up to 2 hands and outputs 21 landmark points per hand — every joint, fingertip and palm tracked in real-time.
๐Ÿ‘‹
GESTURE CLASSIFIER
Custom classifier detects write / fist / open / neutral gestures using fingertip vs. knuckle Y-position comparisons.
⚛️
PARTICLE PHYSICS ENGINE
Orbit force spirals particles → Shell force maintains ideal radius → Element drift pushes fire UP / ice SIDEWAYS → noise adds organic chaos.
๐Ÿ–ผ️
LAYER COMPOSITING
Dark camera (30% brightness) + star field + canvas (air-drawn trails) + particle glow — composited with cv2.add for HDR brightness.
๐Ÿ“Š
HUD OVERLAY → FINAL OUTPUT
FPS counter, hand labels, and control hints overlaid last. Final frame shown in cv2.imshow window — zero game engine required.

๐ŸŽฎ Controls

GESTURE + KEYBOARD REFERENCE

Left hand in frame๐Ÿ”ฅ Summons Fire particles — blazing upward spiral
Right hand in frame❄️ Conjures Ice particles — shimmering crystal field
Both hands close (<180px)⚡ Fusion mode — dual-element collision vortex
Point index finger✍️ Air-draw mode — glowing trails persist on canvas
Close fist๐Ÿ’ฅ Explode — particles blast radially outward
Open palm๐ŸŒ€ Calm orbit mode — gentle spiral
QQuit the application
RReset all particles and clear canvas
SSave screenshot to screenshots/ folder
FToggle fullscreen mode
BToggle 300-star ambient star field
1 2 3Switch colour themes — live, no restart needed

๐Ÿš€ Quick Start

1

Clone the Repository

Download the project from GitHub to your machine.

git clone https://github.com/upendra8690/fire-ice-write.git cd fire-ice-write
2

Create a Virtual Environment

Isolate dependencies cleanly from your system Python.

python -m venv venv .\venv\Scripts\Activate.ps1 # Windows # source venv/bin/activate # macOS / Linux
3

Install Dependencies

Use exact versions for stability.

pip install opencv-python numpy pip install mediapipe==0.10.8 protobuf==3.20.3
4

Run the Magic ✨

Show your hands to the camera and let the particles fly!

python main.py

๐Ÿ’ป Physics Engine (Core Snippet)

main.py — Particle.update()
# Orbit force — spirals particle around hand
nx = dx / best_d  # Normal (radial) direction
ny = dy / best_d
tx = -ny           # Tangent (orbit) direction
ty =  nx

t_strength = ORBIT_FORCE * (1.0 - best_d / hand_radius_logic)
fx += tx * t_strength * 9.0
fy += ty * t_strength * 9.0

# Shell force — maintains ideal orbit radius
shell_err = IDEAL_ORBIT_R - best_d
fx += nx * shell_err * REPEL_FORCE

# Element drift — fire UP, ice SIDEWAYS
if self.element == 'Fire':
    fy -= 0.6   # Fire rises against gravity
elif self.element == 'Ice':
    fy += 0.3   # Ice drifts downward

# Add organic noise for natural feel
fx += random.gauss(0, NOISE_F)

๐Ÿ”ง Troubleshooting

⚠️
ModuleNotFoundError: No module named 'cv2'
You're not inside your venv. Activate it first, then run pip install opencv-python
⚠️
module 'mediapipe' has no attribute 'solutions'
Wrong version. Run: pip install mediapipe==0.10.8 protobuf==3.20.3
⚠️
Camera not found / black screen
Change cv2.VideoCapture(0) to cv2.VideoCapture(1) in main.py
⚠️
Low FPS / laggy particles
Reduce PARTICLE_COUNT in main.py from 5000 to 2000–3000

๐Ÿ‘จ‍๐Ÿ’ป Author

๐Ÿง‘‍๐Ÿ’ป
Mopuru Upendra Reddy
@upendra8690

"Built with Python, physics math, and zero game engines."

Star It. Fork It. Build It.

Open-source and free. If it impressed you, a ⭐ on GitHub means the world.

 

Comments

Popular posts from this blog

๐ŸŽ“ I Built a Student Grade Book Web App — Python + Live Dashboard | Infosys Ed-Tech | Mopuru Upendra Reddy

๐Ÿš€ ONCO Breast Cancer Detection System (2026)