A template to quickly get up and running with threejs
https://threejs-dev-template.onrender.com
- JavaScript 99%
- HTML 1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Add Engine class for renderer and animation loop management - Add Scene class for scene graph, camera, and lighting - Add GameObject base class with chainable API - Add primitives: Box, Sphere, Plane, Cylinder, Torus - Add named color utility (supports 'red', 'coral', etc.) - Add built-in animations: spin(), float() with replacement behavior - Support multiple animations via onUpdate() stacking |
||
| src | ||
| .gitignore | ||
| index.html | ||
| LICENSE | ||
| main.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| vite.config.js | ||
Three.js Development Template
A minimal development template for Three.js projects using Vite.
Live preview (may take a moment for render to spin up)
https://threejs-dev-template.onrender.com
Quick Start
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
Structure
- Base
ThreeSceneclass for scene management - Example
ColorCubeimplementation - Responsive window handling
- Easy to extend template structure
Customization
To create your own scene:
- Modify the
ColorCubeclass, or - Create a new class extending
ThreeScene - Remove the
ColorCubeclass entirely
Author
Lance Days
License
MIT