A low-poly retro 3D model generator powered by AI chat interface. Create and modify 3D models using natural language through OpenRouter's best LLMs.
- 🎨 Chat-based 3D Generation - Describe what you want and watch it appear
- 🔐 Secure OAuth Authentication - Using @hyperyai/sdk
- 🌐 OpenRouter Integration - Access to Claude 3.5 Sonnet and other top LLMs
- 🎮 Interactive 3D Scene - Built with React Three Fiber and drei
- 💅 Modern UI - Vercel AI SDK components and Tailwind CSS
- 🚀 Next.js 16 - Latest Next.js with App Router
- Frontend: Next.js 16, React 19, TypeScript
- 3D Graphics: React Three Fiber v9, Three.js, @react-three/drei
- AI/Chat: Vercel AI SDK, OpenRouter
- Auth: @hyperyai/sdk (OAuth 2.0 + PKCE)
- Styling: Tailwind CSS v4, shadcn/ui components
- LLM: Claude 3.5 Sonnet (via OpenRouter)
✨ Latest Versions: Using React 19.2.0, React Three Fiber 9.4.0, and Tailwind CSS 4.1.17!
- Node.js 18+ and npm/pnpm/yarn
- A Hypery account with OAuth app configured
- OpenRouter access through Hypery
- Install dependencies:
npm install
# or
pnpm install
# or
yarn install- Set up environment variables:
Copy .env.example to .env.local:
cp .env.example .env.localThen edit .env.local with your OAuth credentials:
NEXT_PUBLIC_OAUTH_CLIENT_ID=your_client_id
NEXT_PUBLIC_REDIRECT_URI=http://localhost:3006/callback
NEXT_PUBLIC_AUTH_URL=http://localhost:3001How to get OAuth credentials:
-
Go to your Hypery dashboard
-
Navigate to Apps section
-
Create a new app or select existing one
-
Copy the Client ID
-
Set redirect URI to
http://localhost:3006/callback -
Run the development server:
npm run dev
# or
pnpm dev
# or
yarn dev- Open your browser:
Navigate to http://localhost:3006
Try these prompts to get started:
- "Make a girl on a pony" - Creates a simple representation with shapes
- "Add a red sphere" - Adds a red sphere to the scene
- "Make the pony purple" - Changes the color of the last object
- "Add a blue cone" - Adds a cone with specified color
- "Remove the last object" - Removes the most recent shape
- "Clear everything" - Resets the scene
- Box/Cube
- Sphere/Ball
- Cone
- Torus/Donut
- Cylinder
red, blue, green, yellow, purple, orange, pink, cyan, magenta, white, black, gray
- Left-click + drag: Rotate camera
- Right-click + drag: Pan camera
- Scroll wheel: Zoom in/out
fiber/
├── app/
│ ├── api/chat/route.ts # Chat API with OpenRouter
│ ├── callback/page.tsx # OAuth callback handler
│ ├── layout.tsx # Root layout with HyperyProvider
│ ├── page.tsx # Main app page
│ └── globals.css # Global styles
├── src/
│ ├── components/
│ │ ├── Scene.tsx # React Three Fiber 3D scene
│ │ └── ChatInterface.tsx # Chat UI component
│ └── lib/
│ └── utils.ts # Utility functions
└── package.json
- User clicks "Sign In"
- Redirected to Hypery OAuth page
- User authorizes the app
- Redirected back to
/callback - Auth tokens stored in localStorage
- Ready to chat and create!
- User types a prompt in chat
- Request sent to
/api/chat/route.tswith Hypery auth - OpenRouter (Claude 3.5 Sonnet) generates response
- Response streamed back to client
handleModelUpdateparses the instruction- Scene updates with new/modified 3D models
Edit ChatInterface.tsx to use a different model:
sendMessage({ text: input }, {
body: {
model: 'openai/gpt-4o', // or any OpenRouter model
},
});Edit Scene.tsx to add new geometry types:
{geometry === 'pyramid' && <tetrahedronGeometry args={[0.6]} />}Adjust lighting in Scene.tsx:
<ambientLight intensity={0.6} />
<directionalLight position={[10, 10, 10]} intensity={1.5} />For production, integrate with actual 3D model generation APIs:
- Use Replicate's 3D models (via Hypery predictions API)
- Models like
gfodor/text2voxfor voxel models - Or
meshy/meshy-1for mesh generation
Example:
// In your API route
const response = await fetch(`${AI_GATEWAY_URL}/api/v1/predictions`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gfodor/text2vox',
provider: 'replicate',
input: { prompt: userPrompt },
}),
});To enable MCP-like tool calling (similar to justmakeit):
- Add a tool-orchestration layer
- Implement tool handlers for 3D operations
- Register tools with the chat endpoint
- Use structured outputs for precise model updates
- Push your code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Update redirect URI to your production URL
- Deploy!
Works on any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- Cloudflare Pages
- Self-hosted with Node.js
- Make sure you've set up
.env.localwith valid OAuth credentials - Check that your redirect URI matches in both
.env.localand your OAuth app settings
- Check browser console for Three.js errors
- Make sure WebGL is enabled in your browser
- Try a different browser (Chrome/Firefox recommended)
- Verify your Hypery URL is correct
- Check that you have credits in your Hypery account
- Make sure OpenRouter models are enabled in your account
This example lives in the hypery-examples repo. To contribute:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - See LICENSE file for details
For issues or questions:
- GitHub Issues: hypery/issues
- Discord: Hypery Community
- Email: support@hypery.ai
Built with ❤️ using React Three Fiber and Hypery