DEPLOYED AT: https://three0.vercel.app/
Three0 is an AI-powered tool that generates 3D scenes using natural language. The user types a prompt, and the system generates valid React Three Fiber code with a live-rendered preview.
- Convert natural language prompts to 3D scenes
- Powered by OpenAI's GPT models (using gpt-4.1)
- Real-time 3D preview with React Three Fiber
- View the generated code with syntax highlighting
- Self-correcting AI that can fix broken scenes automatically
- Sandboxed code execution for safety and reliability
- Simple and intuitive UI
- Advanced Material Rendering for realistic water and glass using meshPhysicalMaterial
- Particle Systems using instancedMesh for efficient rendering of many objects
- Animated Vertex Displacement for realistic water surfaces
- Next.js (App Router)
- React Three Fiber (@react-three/fiber)
- Drei for helpers (@react-three/drei)
- Tailwind CSS for styling
- OpenAI API for LLM scene generation
- Zustand for state management
- Sandpack from CodeSandbox for secure code previews
- React-Syntax-Highlighter for code display
- Clone the repository
- Install dependencies:
npm install - Create a
.env.localfile with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
OPENAI_MODEL=gpt-4.1-mini
- Run the development server:
npm run dev - Open http://localhost:3000 in your browser
- Enter a natural language prompt describing the 3D scene you want to create
- Click "Generate Scene"
- View the 3D preview in the right panel
- If the scene has errors, the AI will automatically attempt to fix them
- Toggle between "Preview" and "Code" tabs to see the generated code
- Copy the code to use in your own projects
Three0 uses Sandpack to run generated code in an isolated iframe, ensuring:
- Complete isolation from the main application
- Protection from malicious code execution
- Reliable error handling and reporting
- Consistent preview rendering
- Add the ability to edit generated code and see changes live
- Implement export functionality for downloading scenes
- Add user authentication and saved scenes
- Create a gallery of example scenes
- Add more complex scene types and templates
MIT