This GitHub repository contains the source code for a 3D Earth Visualization Website built using Three.js. The website features a rotating Earth with dynamic controls, allowing users to adjust rotation speed, planet tilt, star count, and more! ๐ The planet's surface, clouds, and city lights are rendered with realistic textures, and a starfield surrounds the Earth for added visual appeal. ๐
Live demo of the project is hosted on Netlify. ๐
Check out the live demo of the project here:
- Name: Harman Deep Singh
- GitHub: Harman8815
- Netlify: Earth on Netlify
- Languages: HTML, CSS, JavaScript
- Library: Three.js (3D Rendering), OrbitControls.js (Camera Controls), Lil-GUI (UI Controls)
- Hosting: Netlify
Prerequisites:
- Clone the repository to your local machine:
git clone https://github.com/Harman8815/earth-project.git
- Navigate to the project directory:
cd earth-project
- Install dependencies:
npm install
Run the Development Server:
- Start the local server:
npm run dev
- Open your browser and go to
http://localhost:3000
.
- ๐ 3D Earth Visualization with textures for the surface, clouds, and city lights.
- โจ Starfield with dynamic star count (up to 20,000 stars).
- ๐ฎ Interactive Controls using lil-gui to adjust:
- ๐ Number of stars
- ๐ Rotation speed of the Earth
- ๐ Tilt angle of the Earth
- ๐ Glow effect around the planet
- ๐ Smooth camera movement using OrbitControls.
- ๐ฅ๏ธ Responsive Design: The website automatically adjusts to different screen sizes.
- ๐ Open the Earth Visualization website in your browser.
- ๐จ Adjust the settings using the GUI Panel:
- ๐ Change the stars count.
- ๐ Adjust the planet rotation speed.
- ๐ Modify the planet's tilt angle.
- ๐ Change the glow effect around Earth.
- ๐ Watch the Earth rotate in real-time with the settings you've configured.
-
Build the project for production:
npm run build
-
Deploy the
earth_output
folder to a hosting service like Netlify.
index.html
: The entry point of the project.main.js
: JavaScript file containing Three.js logic and rendering.textures/
: Folder containing textures for the Earth's surface, clouds, and city lights.earth_output/
: Folder containing the built version of the project, used for deployment.
Feel free to fork the repository, make changes, and submit pull requests. Contributions are welcome! ๐