Real-time AI-powered motion capture for VRM avatars in the browser.
Morphix is a browser-based 3D motion capture system that maps live webcam input to fully rigged VRM avatars in real time. It combines MediaPipe Holistic tracking with Kalidokit solving and renders the result using React Three Fiber and Three.js.
Designed for:
- VTuber-style avatars
- Motion-driven 3D characters
- Web-based interactive avatars
- Experimental real-time animation pipelines
- React 19
- TypeScript
- Vite
- TailwindCSS
- Leva (debug controls)
- Three.js
- React Three Fiber
- Drei
- Postprocessing (Bloom)
- MediaPipe Holistic
- Kalidokit
- Three-VRM (@pixiv/three-vrm)
- Zustand
Morphix runs entirely in the browser:
-
Webcam feed captured using MediaPipe Camera
-
Holistic model detects:
- Face landmarks
- Pose landmarks
- Hand landmarks
-
Kalidokit converts landmarks into rig data
-
VRM humanoid bones & blendshapes updated per frame
-
Optional fallback to preloaded Mixamo animations
flowchart LR
Webcam --> MediaPipe
MediaPipe -->|Landmarks| Kalidokit
Kalidokit -->|Rig Data| VRMAvatar
VRMAvatar --> ThreeJS
ThreeJS --> Canvas
This is a single-application Vite project.
- Initializes MediaPipe Holistic
- Captures webcam stream
- Draws pose/face/hand landmarks
- Publishes results to global store (Zustand)
-
Loads VRM model
-
Applies:
- Facial blendshapes
- Bone rotations
- Eye tracking
- Finger tracking
-
Falls back to animation mixer when webcam is off
- Scene composition
- Lighting
- Environment preset
- Camera controls
- Avatar selector
- Postprocessing (Bloom)
Global store containing:
- Active video element
- MediaPipe results callback
Converts Mixamo FBX animations to VRM-compatible AnimationClips using:
- Bone name mapping
- Quaternion space correction
- Hips scale normalization
.
โโโ public/
โโโ src/
โ โโโ assets/
โ โ โโโ animations/
โ โ โโโ icons/
โ โ โโโ models/
โ โโโ components/
โ โ โโโ camera-widget.tsx
โ โ โโโ experience.tsx
โ โ โโโ vrm-avatar.tsx
โ โโโ hooks/
โ โ โโโ video-recognition.ts
โ โโโ utils/
โ โ โโโ mixamo-vrm-rig-map.ts
โ โ โโโ remap-mixamo-animation-to-vrm.ts
โ โโโ App.tsx
โ โโโ main.tsx
โ โโโ index.css
โโโ vite.config.ts
โโโ tsconfig.json
โโโ package.json
sequenceDiagram
participant User
participant CameraWidget
participant MediaPipe
participant Kalidokit
participant VRMAvatar
User->>CameraWidget: Enable Camera
CameraWidget->>MediaPipe: Process Frame
MediaPipe->>CameraWidget: Return Landmarks
CameraWidget->>VRMAvatar: Send Results
VRMAvatar->>Kalidokit: Solve Pose
Kalidokit->>VRMAvatar: Rig Data
VRMAvatar->>VRM Model: Apply Rotations & Expressions
If webcam is disabled:
- AnimationMixer runs
- Mixamo animations are remapped to VRM
- Selected clip is played
- Eye blink detection
- Mouth vowel shapes (AA, EE, IH, OH, OU)
- Head rotation
- Eye look-at system
- Spine
- Hips
- Arms
- Forearms
-
Full finger articulation:
- Thumb
- Index
- Middle
- Ring
- Little
-
All segments:
- Proximal
- Intermediate
- Distal
- Expression sliders
- Animation selector
- Avatar switcher
- Node.js 18+
- npm or pnpm
- Webcam
git clone https://www.github.com/grep-many/morphix.git
cd morphix
npm installnpm run devOpen:
http://localhost:5173
npm run build
npm run previewNo required environment variables.
MediaPipe models are loaded via CDN:
https://cdn.jsdelivr.net/npm/@mediapipe/holistic/
- Start the dev server
- Click the camera button
- Grant webcam permission
- Move in front of camera
- Avatar mirrors your motion
Optional:
- Switch avatar via Leva panel
- Disable camera to test animations
- VRM models are humanoid and properly rigged
- Mixamo animations contain
mixamo.comclip name - User has webcam access
- Running in a modern browser with WebGL2
- Offload Holistic processing to Web Worker
- GPU acceleration optimization
- Adaptive resolution based on device capability
- Frame throttling for low-end systems
- Local-only processing (no server transmission)
- CSP tightening for CDN loads
- Strict typing for bone mapping
- Test harness for animation remapping
- Storybook for avatar testing
- Frame time diagnostics
- Pose confidence metrics UI
- Error boundary for model loading
- Audio-driven lip sync
- Multi-user support
- WebRTC avatar streaming
- Networked VRM avatars
- Gesture recognition events
- Recording & export to GLTF animation
Morphix demonstrates a complete real-time browser-based motion capture pipeline:
- Webcam โ AI landmark detection
- Landmark solving โ Rig transforms
- VRM humanoid animation
- Three.js rendering
- Interactive debugging controls
It serves as a strong foundation for web-based virtual avatars, VTuber systems, and experimental real-time animation tooling.
