A comprehensive demo application that generates 3D objects from user prompts and makes them viewable in AR, using Model Context Protocol (MCP) as the orchestration layer.
- Prompt-based 3D Model Generation: Generate 3D models from text descriptions
- Tripo AI Integration: Powered by Tripo AI API for high-quality 3D model generation
- AR Preview: View models in AR using WebXR and model-viewer
- MCP Integration: Model Context Protocol orchestration layer
- Cross-platform AR: Works on iOS, Android, and Web browsers
- Modern UI: Beautiful, responsive web interface
- Python 3.8+
- Tripo AI API key
- Modern web browser with WebXR support
- iOS device for AR Quick Look (optional)
git clone https://github.com/hamadhk7/3D-AR-GENERATOR.git
cd 3D-AR-GENERATORpip install -r requirements.txtCreate a .env file in the root directory:
TRIPO_API_KEY=your_tripo_api_key_here
FLASK_ENV=development
FLASK_DEBUG=Truepython scripts/start_web_server.pyThe application will be available at http://localhost:5000
- Prompt: "Generate me a detailed 3D model of a futuristic motorcycle"
- Expected Output: High-quality GLB model of a futuristic motorcycle
- AR View: Click "View in AR" to see in augmented reality
- Prompt: "A metallic coffee cup with leather seats"
- Expected Output: Realistic coffee cup model with metallic finish
- AR View: Available in both WebXR and AR Quick Look
- Prompt: "A cool bumble bee animated character"
- Expected Output: Animated 3D character model
- AR View: Interactive AR experience
- Reasoning: High-quality 3D model generation with realistic textures
- API Endpoints:
/task,/task/{id},/task/health - Output Formats: GLB, OBJ, USDZ support
- Response Time: 30-60 seconds for model generation
- User submits prompt via web interface
- MCP orchestrates API call to Tripo AI
- System polls for generation completion
- Model downloaded in GLB format
- AR preview generated automatically
- Generate a 3D model
- Click "Download USDZ" (if available)
- Open the USDZ file on iOS device
- Tap "View in AR" for AR Quick Look experience
- Generate a 3D model
- Click "View in AR" button
- Grant camera permissions
- Experience AR through WebXR
- Generate a 3D model
- Click "View Model" for 3D preview
- Use mouse/touch to rotate and zoom
- Toggle wireframe mode for technical view
- MCP Server:
src/mcp_server/server.py - Tools: Model generation, credit management, file handling
- Handlers: Request processing and response formatting
- Flask App:
src/web/app.py - API Routes:
src/web/routes/api.py - Model Routes:
src/web/routes/models.py - Templates: Modern, responsive UI
- Download: Automatic GLB file download
- Storage: Local file system with caching
- Conversion: Ready for USDZ conversion
- Preview: Three.js integration for 3D viewing
The demo showcases:
- Prompt Input: User enters "A metallic coffee cup with leather seats"
- Generation Process: Real-time progress tracking
- Model Download: Automatic GLB file retrieval
- AR Preview: WebXR AR experience
- Cross-platform: Works on mobile and desktop
- API Keys: Stored securely in
.envfile (not in repository) - CORS: Properly configured for cross-origin requests
- File Security: Safe file serving with validation
- Error Handling: Comprehensive error management
- Generation Time: 30-60 seconds per model
- File Size: Optimized GLB files (1-10MB)
- Caching: Local file caching to reduce API calls
- Credit Management: Real-time credit tracking
python scripts/start_web_server.py# Using Docker
docker-compose up -d
# Using Python directly
gunicorn src.web.app:app- API Setup:
API_SETUP_GUIDE.md - Testing:
TESTING_GUIDE.md - Configuration:
config/settings.py - Logs:
data/logs/directory
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
Note: This demo application successfully demonstrates all required features including MCP integration, 3D model generation, AR preview capabilities, and cross-platform compatibility.