An interactive Three.js application featuring Michelle, a 3D character that responds to hand gestures in real-time, with a live webcam feed as the background.
- Real-time hand tracking using MediaPipe Hands
- Gesture-based animations (must hold gesture for 3 seconds):
- โ๏ธ Peace Sign โ Greeting wave (Standing Greeting)
- ๐ Thumbs Up โ Jump animation (Jumping)
- โ Fist โ Spin animation
- Position tracking - Robot follows hand movement in real-time
- Rotation control - Robot orientation responds to hand position
- FBX Animation Support:
- Standing Idle (looped)
- Standing Greeting (wave)
- Jumping
- Northern Soul Spin
- ๐ง Michelle character (FBX)
- ๐ท Live mirrored webcam feed as scene background
- ๐ก Professional lighting setup (Directional + Ambient)
- ๐ฏ Auto-centering and auto-scaling
- โก Smooth interpolated movements
- Node.js (v14 or higher)
- npm or yarn
- Webcam (required for hand tracking)
- Modern browser with WebGL support
- Good lighting conditions for optimal hand detection
- Clone the repository:
git clone https://github.com/yourusername/Team-26.git
cd Team-26- Install dependencies:
npm install- Add required 3D models and animations to the
publicfolder:
character.fbx- Michelle character modelStanding Idle.fbx- Idle animationStanding Greeting.fbx- Greeting wave animationJumping.fbx- Jump animationNorthern Soul Spin.fbx- Spin animation
Start the development server:
npm run devThe application will open at http://localhost:5173.
Important: Allow webcam access when prompted - it's required for hand tracking!
Build for production:
npm run buildPreview the production build:
npm run preview- Launch the app and allow webcam access
- Position your hand in front of the webcam
- Hold a gesture for 3 seconds to trigger animations:
- โ๏ธ Peace sign โ Greeting wave
- ๐ Thumbs up โ Jump
- โ Closed fist โ Spin
- Move your hand to control the robot's position and rotation
- The robot will automatically return to center when no hand is detected
.
โโโ index.html # Main HTML entry point
โโโ src/
โ โโโ main.js # Main application logic
โโโ public/
โ โโโ character.fbx # Michelle character model
โ โโโ Standing Idle.fbx # Idle animation
โ โโโ Standing Greeting.fbx # Greeting wave animation
โ โโโ Jumping.fbx # Jump animation
โ โโโ Northern Soul Spin.fbx # Spin animation
โโโ package.json # Dependencies and scripts
โโโ README.md # This file
- three - 3D graphics library
- three-fbx-loader - FBX animation loader
- @mediapipe/hands - Hand tracking ML model
- @mediapipe/camera_utils - Camera utilities
- vite - Build tool and dev server
- Rendering: Three.js WebGL renderer with high-performance settings
- Hand Tracking: MediaPipe Hands with real-time landmark detection
- Animations: THREE.AnimationMixer for FBX animations
- Background: Live webcam feed with mirrored texture
- Gesture Detection: 3-second hold requirement to prevent accidental triggers
- Smooth interpolation for movements (0.15 smoothing factor)
- Automatic model centering and scaling
- Efficient gesture state management
- Background process for hand tracking
- Ensure good lighting conditions
- Position hand clearly in front of camera
- Try adjusting hand distance from camera
- Check browser console for MediaPipe errors
- Verify all FBX files are in the
publicfolder - Check browser console for loading errors
- Ensure FBX files contain valid animation data
- Grant camera permissions in browser settings
- Close other apps using the webcam
- Try refreshing the page
- Check browser compatibility (Chrome recommended)
- Close other browser tabs
- Ensure hardware acceleration is enabled
- Lower video quality in camera settings
- Check CPU/GPU usage
In main.js, change the hold duration:
let gestureHoldDuration = 3000; // milliseconds (3 seconds)Change initial position:
robot.position.set(0, -2, 0); // x, y, z coordinatesModify animation mixer time scale:
animationMixer.timeScale = 1.0; // 1.0 = normal speedAdjust light intensity:
const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5); // intensity
const ambientLight = new THREE.AmbientLight(0xffffff, 0.6);- Chrome/Edge (Recommended) - Full WebGL and MediaPipe support
- Firefox - Supported
- Safari - Supported (may require permissions setup)
Requires:
- WebGL 2.0 support
- Webcam access
- JavaScript enabled
- Three.js - 3D graphics rendering
- MediaPipe - Google's hand tracking solution
- FBX Animations - Mixamo animation library
This project is for educational purposes.
Made with โค๏ธ using Three.js and MediaPipe
Works best in modern browsers with WebGL 2.0 support:
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
[Add your license here]
[Add contribution guidelines here]
- Three.js library
- Michelle character model: [Add source/credits]