Procedural Planet Generator
A browser-based 3D procedural planet generator built with Three.js. Planets are generated using fractal simplex noise with seeded randomization, giving you reproducible results from any seed value.
- Procedurally generated terrain using seeded fractal simplex noise (two layers: base + fine detail)
- Height-based color mapping across three elevation zones (ocean → land → mountain)
- Fully adjustable terrain parameters: planet radius, noise scale, and mountain height
- Custom color controls for each terrain zone with preset and hex input options
- Manual seed input — type any seed and hit Apply to get that exact planet back
- Randomize button for quick exploration, with deterministic results per seed
- Animated star field with three depth layers and twinkling point lights
- Wireframe toggle
- Collapsible UI panel
├── main.js # Scene setup, camera, lighting, UI event handling
├── planet.js # Planet class — terrain generation, color mapping, randomization
├── stars.js # Stars class — instanced mesh star field with animated lights
├── lcg.js # LCG random number generator for seeded/reproducible noise
- Node.js (v16 or higher)
- npm
npm installnpm run devThen open your browser to the local address shown in the terminal (typically http://localhost:5173 if using Vite).
- Three.js — 3D rendering
Drag to spin the planet, change planet parameters by using sliders.
| Input | Action |
|---|---|
| Left click + drag | Rotate |
| Scroll | Zoom |
| Control | Description |
|---|---|
| Planet Size | Adjust the radius of the planet |
| Noise Scale | Controls the frequency of terrain features |
| Mountain Height | Controls the amplitude of terrain displacement |
| High / Mid / Low Color | Set colors for each elevation zone (preset picker or hex input) |
| Seed | Type any integer to get a specific planet, manual seed takes priority over auto-computed seed on Apply |
| Apply Changes | Regenerate the planet with current settings |
| Randomize | Generate a random planet deterministically from the current seed |
| Wireframe | Toggle wireframe view |
| Hide | Collapse/expand the UI panel |
The seed controls terrain generation. There are two ways it gets set:
- Manual — type a seed in the seed field and press Apply. That seed is used as-is and the planet will always be reproducible from it.
- Auto-computed — if the seed field is empty, a seed is derived from the current parameter values (radius, noise, mountain height, colors) so similar settings produce related seeds.
The Randomize button always derives a new deterministic seed from the current one, so randomization chains are also reproducible.