This is a simple 3D Earth website I made. It shows a rotating Earth with real textures and lighting.
- Shows a 3D Earth that rotates slowly
- Has day and night textures
- Stars in the background
- Simple controls to move around
- Download the files
- Open terminal in the folder
- Run
npm install - Run
npm run devfor development - Run
npm run buildfor production - Run
npm run previewto see the built version
- Three.js for 3D graphics
- Vite for building
- GSAP for animations
- HTML and CSS for the loading screen
globe1/
├── src/
│ └── main.js (3D Earth code)
├── public/
│ ├── earth-day.jpg (Earth day texture)
│ ├── earth-night.jpg (Earth night texture)
│ └── vision-slowed.mp3 (Background music)
├── index.html (Main page)
├── package.json (Dependencies)
└── vite.config.ts (Build settings)
- Realistic Earth textures
- Smooth rotation
- Interactive camera controls
- Performance optimized
- Error handling
- Loading screen
The main code is in src/main.js. It creates a 3D scene with:
- A sphere for Earth
- Textures for day and night
- Lighting for realism
- Stars in the background
- Camera controls for movement
The Earth rotates continuously and you can zoom in/out and move around with your mouse.
Run npm run build to create the production files in the dist folder. This makes the website faster and smaller.
- Make sure you have the music file
vision-slowed.mp3in the public folder - The website needs WebGL support in your browser
- Works best on modern browsers
That's it. Simple 3D Earth website.