A procedurally generated space scene built with Three.js, featuring 10,000 glowing stars and 100 animated asteroids drifting through deep space.
- 10,000 procedurally placed stars with soft glow effect
- 100 asteroids with randomized size, shape, speed and direction
- Rock texture support for realistic asteroid surfaces
- Exponential fog for natural depth falloff
- Directional lighting for 3D shading and shadow
- Asteroids respawn with new random properties when drifting out of range
- Fully responsive — adapts to any screen size
No build tools required. Just open index.html with a local server.
Option 1 – VS Code Live Server
Install the Live Server extension, right-click index.html and select Open with Live Server.
Option 2 – Node.js
npx serve .threejs-starfield/
├── index.html
├── main.js
├── asteroid-texture.jpg
└── README.md
- Three.js r160
MIT
