BAMM (Body Avatar Motion Model) is an advanced web application that transforms natural language descriptions and audio inputs into realistic 3D character animations. Using cutting-edge AI and computer graphics technologies, BAMM enables users to create, visualize, and export custom animated avatars through an intuitive interface.
- Text-to-Motion Generation: Convert natural language into realistic animations
- Audio-to-Motion Synthesis: Generate dance and gesture animations from audio files
- 3D Avatar Customization: Create personalized characters with adjustable body measurements
- Real-time 3D Visualization: Interactive 3D viewport with camera controls
- Motion Retargeting: Apply any animation to any humanoid character
- Multi-format Export: Export animations in GLB, USDZ, FBX, and BVH formats
graph LR
A[User Input] --> B[AI Processing]
B --> C[Motion Data]
C --> D[3D Visualization]
D --> E[Export]
A1[Text Prompts] --> A
A2[Audio Files] --> A
A3[Body Measurements] --> A
B1[Text-to-Motion API] --> B
B2[Audio-to-Motion API] --> B
C1[BVH Files] --> C
C2[GLB Models] --> C
D1[Canvas Rendering] --> D
D2[Motion Retargeting] --> D
E1[GLB Export] --> E
E2[USDZ Export] --> E
E3[FBX Export] --> E
E4[BVH Export] --> E
Data Sources:
- Text Prompts: Natural language descriptions ("person walking", "dancing salsa")
- Audio Files: WAV/MP3 files for rhythm-based motion generation
- Body Measurements: Height, chest, waist, hip, inseam measurements
- Avatar Selection: Pre-built character models
Text-to-Motion Pipeline:
Text Description โ Motion Generation API โ BVH Animation Data
โ
"person walking quickly" โ AI Model โ walking_motion_001.bvh
Audio-to-Motion Pipeline:
Audio File (WAV/MP3) โ Audio Analysis โ Synchronized BVH + Audio
โ
music.mp3 โ Beat Detection + Movement AI โ dance_motion_sync.bvh
Avatar Creation Process:
User Measurements โ SMPL Body Model โ 3D Mesh Generation โ GLB Export
โ โ โ โ
Height: 175cm Body Shape vertices.json avatar.glb
Chest: 100cm โ Proportions โ faces.json โ + textures
Waist: 80cm Skeleton weights.json + skeleton
Animation Transfer Process:
Source BVH โ Skeleton Mapping โ Target GLB โ Retargeted Animation
โ โ โ โ
Motion Data โ SMPL Bone Names โ Avatar Model โ Live Animation
Rendering Pipeline:
GLB Model + BVH Motion โ Three.js Scene โ WebGL Rendering โ Export Options
โ โ โ โ
Character 3D Environment Real-time GLB/USDZ/FBX
+ Animation + Lighting Display Downloads
| Format | Purpose | Structure | Usage |
|---|---|---|---|
| BVH | Motion capture data | Hierarchical joint rotations + positions | Animation source |
| GLB | 3D models | Mesh + Skeleton + Textures (binary glTF) | Avatar rendering |
| JSON | Mesh components | Vertices, faces, weights, UV coordinates | Model construction |
| PNG/JPG | Textures | Albedo, normal, roughness maps | Visual appearance |
HIERARCHY # Skeleton definition
ROOT Hips # Root bone (pelvis)
โโโ JOINT LeftUpLeg # Left thigh
โ โโโ JOINT LeftLeg # Left shin
โ โโโ JOINT LeftFoot # Left foot
โโโ JOINT RightUpLeg # Right thigh
โโโ JOINT Spine # Torso
โโโ JOINT Neck # Neck
โโโ JOINT Head # Head
MOTION # Animation data
Frames: 300 # Number of keyframes
Frame Time: 0.033333 # 30 FPS
[rotation data...] # Per-frame joint rotations
graph TB
GLB[GLB File] --> MESH[3D Mesh]
GLB --> SKEL[Skeleton]
GLB --> TEX[Textures]
GLB --> ANIM[Animations]
MESH --> VERT[Vertices]
MESH --> FACE[Faces/Triangles]
MESH --> UV[UV Coordinates]
SKEL --> BONE[55 SMPL Bones]
SKEL --> HIER[Bone Hierarchy]
SKEL --> WEIGHT[Skin Weights]
TEX --> ALB[Albedo Map]
TEX --> NORM[Normal Map]
TEX --> ROUGH[Roughness Map]
Head (15)
|
Neck (12)
|
LeftEye(23) Spine2 (9) RightEye(24)
|
LeftShoulder(13) -- Spine1 (6) -- RightShoulder(14)
| | |
LeftArm(16) Spine (3) RightArm(17)
| | |
LeftForeArm(18) Hips (0) RightForeArm(19)
| / \ |
LeftHand(20) / \ RightHand(21)
LeftUpLeg(1) RightUpLeg(2)
| |
LeftLeg(4) RightLeg(5)
| |
LeftFoot(7) RightFoot(8)
| |
LeftToe(10) RightToe(11)
- Root:
Hips(pelvis, center of mass) - Limbs:
Left/Right + UpLeg/Leg/Foot(legs),Left/Right + Arm/ForeArm/Hand(arms) - Spine:
Spine,Spine1,Spine2(lower to upper back) - Head:
Neck,Head,LeftEye,RightEye,Jaw - Fingers: 30 finger bones (5 per finger ร 3 joints ร 2 hands)
graph LR
BVH[Source BVH] --> EXTRACT[Extract Skeleton]
EXTRACT --> MAP[Map Bone Names]
MAP --> SCALE[Scale Proportions]
SCALE --> RETARGET[Apply to GLB]
RETARGET --> NORMALIZE[Hip Normalization]
NORMALIZE --> RENDER[3D Animation]
EXTRACT --> SRC_BONES[Source Bone Names]
MAP --> TGT_BONES[Target SMPL Names]
SCALE --> RATIOS[Bone Length Ratios]
NORMALIZE --> GROUND[Ground Alignment]
- React 18: Component framework with hooks
- Next.js 13: Full-stack framework with app router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Three.js: 3D graphics and WebGL rendering
- Three.js Loaders: BVHLoader, GLTFLoader for file parsing
- SkeletonUtils: Motion retargeting and bone mapping
- Animation System: Mixers, clips, and keyframe interpolation
- WebGL: Hardware-accelerated 3D rendering
- Radix UI: Accessible, unstyled UI primitives
- Lucide React: Modern icon library
- Class Variance Authority: Component variant management
- Motion Generation:
https://handy-lamb-enough.ngrok.app/generate-motion - Audio-to-Motion:
https://audio-motion.ngrok.app/generate-motion/ - File Management: Internal Next.js API routes
User enters text prompt โ "person doing jumping jacks"
โ
AI processes request โ Motion generation API
โ
BVH file generated โ jumping_jacks_motion.bvh
Choose existing avatar โ Browse avatar grid
OR
Create custom avatar โ Adjust body measurements
โ
GLB model ready โ Personalized character
BVH motion + GLB avatar โ Motion retargeting system
โ
Skeleton mapping โ SMPL bone alignment
โ
Live 3D animation โ Character performing jumping jacks
Choose export format โ GLB (web), USDZ (iOS AR), FBX (professional)
โ
Download file โ Import into other applications
- Chatbot Interface: Text prompt input and motion generation
- 3D Canvas: Real-time character animation viewport
- Avatar Grid: Character selection and customization
- Control Panels: Import, export, measurement adjustment
- Navigation: Sidebar with panel switching
- Orbit Controls: Mouse/touch camera manipulation
- Auto-framing: Camera automatically positions based on character size
- Lighting: Professional 3-point lighting setup
- Audio Sync: Animation synchronized with uploaded audio
- Performance: Optimized for 60fps real-time rendering
Different characters have different:
- Bone lengths (tall vs. short characters)
- Proportions (arm/leg ratios)
- Skeleton naming (different bone name conventions)
- Standardized naming: Consistent bone names across all models
- Proportional scaling: Automatic bone length ratio calculations
- Hip normalization: Ensures feet stay on ground regardless of character height
Source Motion โ Target Character
โ โ
BVH rotations โ Scale by bone length ratios โ GLB rotations
BVH positions โ Adjust for character height โ GLB positions
- Node.js 18+
- Modern web browser with WebGL support
- Internet connection for AI motion generation APIs
git clone https://github.com/your-repo/bamm-wa
cd bamm-wa
npm install
npm run dev- Open application in web browser
- Enter text prompt describing desired motion
- Click "Generate" to create BVH animation
- Select avatar from grid or create custom character
- View animation in 3D viewport
- Export in desired format (GLB, USDZ, FBX, BVH)
- Lazy loading: Assets loaded only when needed
- Memory management: Proper Three.js resource disposal
- Animation efficiency: Optimized bone matrix calculations
- LOD system: Level-of-detail for complex models
- Asset caching: Local storage for frequently used files
- Progressive loading: Streaming for large models
- API optimization: Efficient motion generation requests
- Real-time collaboration: Multi-user motion editing
- Advanced physics: Cloth simulation and soft-body dynamics
- Facial animation: Expression generation from audio
- Motion blending: Smooth transitions between animations
- VR/AR support: Immersive character interaction
- Neural motion synthesis: Advanced AI motion generation
- Style transfer: Personality-based animation adaptation
- Procedural animation: Rule-based motion systems
MIT License - See LICENSE file for details.
- SMPL Model: Max Planck Institute for Intelligent Systems
- Three.js Community: 3D web graphics framework
- Motion Capture Data: Various mocap databases and contributors
BAMM empowers creators to bring their imagination to life through AI-powered motion generation and 3D character animation.