Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GestureKart

ย GestureKart AI Racing

AI Gesture-Controlled Racing โ€” Steer With Your Hands, No Controller Needed

Live Demo

TypeScript Three.js MediaPipe Hands Vite WebGL

Last Commit Repo Size AI Powered Open Source


Games ยท Features ยท How It Works ยท Architecture ยท Tech Stack ยท Getting Started


GestureKart AI Racing is a browser racing experience with a twist: your hands are the steering wheel. Two games in one โ€” a 3D night-drive racing sim controlled entirely by webcam hand gestures, plus a classic arcade Kart Racing mode. Built with Three.js for 3D rendering and MediaPipe Hands for real-time hand tracking.

Race through a neon-lit cyberpunk tunnel at 60 FPS โ€” or fall back to keyboard, touch, or even phone gyroscope controls on any device.


๐ŸŽ๏ธ Games Included

Mode Description Controls
Virtual Steering 3D first-person racer through a neon tunnel with HUD, speed gauge, gearbox, and obstacle traffic Hands (webcam) ยท Keyboard ยท Touch
Kart Racing Fast-paced arcade kart racer with its own menu, tracks, and gameplay loop Keyboard ยท Touch

โœจ Features

๐Ÿ–๏ธ Hand-Gesture Steering (Flagship)

  • Drive with both hands โ€” car accelerates when both hands are detected; palms mapped to steering angle
  • Smooth tracking โ€” exponential landmark smoothing + dead zone + non-linear steering curve for natural feel
  • Live camera panel โ€” see your hand skeleton overlay while you play

๐ŸŽฎ Multi-Input System

  • Keyboard โ€” W gas ยท A/D steer ยท U auto-accelerate
  • Touch controls โ€” on-screen buttons for mobile play
  • Gyroscope mode โ€” tilt your phone to steer
  • Auto-accelerate โ€” toggle for hands-free gas

๐ŸŽจ Game Systems

  • 3D cockpit โ€” dashboard, gauges, steering wheel with real-time rotation, mirrors, windshield
  • Obstacle traffic โ€” AI cars to dodge; collisions end the race with screen shake
  • Race timer & score โ€” 90-second race, lap tracking, position, and final results screen
  • Procedural engine audio โ€” Web Audio API synth engine sound scaled to speed
  • Speed lines & vignette โ€” dynamic juice effects at high velocity
  • Sensitivity calibration โ€” adjustable steering sensitivity and smoothing

๐Ÿ•น๏ธ How It Works

flowchart LR
    A[Webcam] --> B[MediaPipe Hands]
    B --> C[Palm Center Extraction]
    C --> D[Smoothing Filter]
    D --> E[Steering Mapping]
    E --> F[3D Camera & Car]
    F --> G[Collision / Score / HUD]

    H[Keyboard] --> D
    I[Touch] --> D
    J[Gyroscope] --> D
Loading
  1. MediaPipe extracts 21 hand landmarks per frame (up to 2 hands)
  2. The palm center (wrist + index + middle MCP) is mapped to a 0โ€“1 steering axis
  3. Exponential smoothing removes jitter; a dead zone prevents drift
  4. The steering axis drives the 3D camera, cockpit, and headlights in Three.js

๐Ÿ—๏ธ System Architecture

src/
โ”œโ”€โ”€ main.ts                 # Entry point: UI, menu flow, game loop
โ”œโ”€โ”€ game/
โ”‚   โ””โ”€โ”€ Game.ts             # Three.js scene, physics, collisions, HUD state
โ”œโ”€โ”€ input/
โ”‚   โ”œโ”€โ”€ HandTracker.ts      # MediaPipe hand pipeline + steering mapping
โ”‚   โ””โ”€โ”€ Keyboard.ts         # Keyboard state handler
โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ smoothing.ts        # Exponential moving-average filter
โ””โ”€โ”€ style.css               # Full UI styling (HUD, panels, overlays)

public/
โ””โ”€โ”€ kart-racing/            # Kart Racing arcade game (standalone page)

Design principles: the hand tracker is input-agnostic โ€” keyboard, touch, and gyro overrides plug into the same steering pipeline.


๐Ÿงฐ Tech Stack

Layer Technology
Language TypeScript
3D Rendering Three.js ยท WebGL
Vision AI MediaPipe Hands
Build Vite
Audio Web Audio API (procedural)
Deployment Vercel

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • A webcam (for hand tracking)

Installation

# 1. Clone & install
git clone https://github.com/Manthan-13521/GestureKart-AI-Racing.git
cd GestureKart-AI-Racing
npm install

# 2. Run the dev server
npm run dev

# 3. Open the game
# http://localhost:5173

Scripts

Script Description
npm run dev Start the Vite dev server
npm run build Type-check + production build
npm run preview Preview the production build

๐Ÿ”ญ Roadmap

  • Multi-track selection & lap racing
  • Leaderboards (local + online)
  • Gesture calibration screen
  • Two-hand asymmetric steering (gas + steer)
  • Mobile PWA install support

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome. Fork the repo, make your change, and open a pull request.


๐Ÿ“„ License

All rights reserved.


ยฉ 2026 Manthan Jaiswal โ€” Built with Three.js, MediaPipe & TypeScript.


๐ŸŽ๏ธ Play GestureKart

Releases

Packages

Contributors

Languages