A comprehensive React/Vite application for AI-powered 3D asset generation, rigging, and fitting. Built for the Hyperscape RPG, this system combines OpenAI's GPT-4 and DALL-E with Meshy.ai to create game-ready 3D models from text descriptions.
- Generate 3D models from text descriptions using GPT-4 and Meshy.ai
- Automatic concept art creation with DALL-E
- Support for various asset types: weapons, armor, characters, items
- Material variant generation (bronze, steel, mithril, etc.)
- Batch generation capabilities
- Interactive 3D viewer with Three.js
- Asset library with categorization and filtering
- Metadata management and asset organization
- GLB/GLTF format support
- Armor Fitting System: Automatically fit armor pieces to character models
- Hand Rigging: AI-powered hand pose detection and weapon rigging
- Weight transfer and mesh deformation
- Bone mapping and skeleton alignment
- Sprite generation from 3D models
- Vertex color extraction
- T-pose extraction from animated models
- Asset normalization and optimization
- Frontend: React 18, TypeScript, Vite
- 3D Graphics: Three.js, React Three Fiber, Drei
- State Management: Zustand, Immer
- AI Integration: OpenAI API, Meshy.ai API
- ML/Computer Vision: TensorFlow.js, MediaPipe (hand detection)
- Backend: Express.js, Node.js
- Styling: Tailwind CSS
- Build Tool: Bun [[memory:4609218]]
- Node.js 18+ or Bun runtime
- API keys for OpenAI and Meshy.ai
- Clone the repository
git clone [repository-url]
cd packages/generation
- Install dependencies using Bun [[memory:4609218]]
bun install
- Create a
.env
file from the example
cp env.example .env
- Add your API keys to
.env
VITE_OPENAI_API_KEY=your-openai-api-key
VITE_MESHY_API_KEY=your-meshy-api-key
Start both frontend and backend services:
# Terminal 1: Start the React app
bun run dev:all
# Or run separately:
bun run dev # Terminal 1: Frontend only
bun run dev:backend # Terminal 2: Backend services
The app will be available at http://localhost:3003
generation/
├── src/ # React application source
│ ├── components/ # UI components
│ ├── services/ # Core services (AI, fitting, rigging)
│ ├── pages/ # Main application pages
│ ├── hooks/ # Custom React hooks
│ └── store/ # Zustand state management
├── server/ # Express.js backend
│ ├── api.mjs # API endpoints
│ └── services/ # Backend services
├── gdd-assets/ # Generated 3D assets [[memory:3843922]]
│ └── [asset-name]/ # Individual asset folders
│ ├── *.glb # 3D model files
│ ├── concept-art.png
│ └── metadata.json
└── scripts/ # Utility scripts
- Text-to-3D model pipeline
- Prompt enhancement with GPT-4
- Concept art generation
- 3D model creation via Meshy.ai
- Material variant generation
- Browse and manage generated assets
- Filter by type, tier, and category
- 3D preview with rotation controls
- Export and download assets
- Manage weapon and armor sets
- Preview equipment combinations
- Configure equipment properties
- Upload character models
- Automatically fit armor pieces
- Adjust positioning and scaling
- Export fitted models
- Upload weapon models
- AI-powered hand pose detection
- Automatic grip point calculation
- Export rigged weapons
GET /api/assets
- List all assetsGET /api/assets/:id/model
- Download asset modelPOST /api/generation/start
- Start new generationPOST /api/retexture/start
- Generate material variantsPOST /api/fitting/preview
- Preview armor fittingPOST /api/hand-rigging/process
- Process hand rigging
bun run dev
- Start frontend development serverbun run dev:all
- Start both frontend and backend development serversbun run dev:backend
- Start backend services onlybun run build
- Build for productionbun run start
- Start production backend servicesbun run assets:audit
- Audit asset librarybun run assets:normalize
- Normalize 3D modelsbun run assets:extract-tpose
- Extract T-poses from models
The system uses JSON-based configuration for:
- Material presets (
public/material-presets.json
) - Asset metadata (stored with each asset) [[memory:3843922]]
- Generation prompts and styles
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.
- Built for the Hyperscape RPG project
- Powered by OpenAI and Meshy.ai APIs
- Uses Three.js for 3D visualization