Welcome to the 3D Model of Planets project! This project generates a 3D model of planets using topographic features and textures, primarily focusing on Earth. The model allows for various customizations and simulations to create an accurate and dynamic representation of planets.
- Venus , Saturn, etc.
- Topographic and Texture Mapping: Generates a 3D model of the planet using topographic data and textures.
- Customizable Radius: Adjust the radius of the planet model.
- Mountain Prominence: Make mountains pop by increasing their prominence.
- Landmass Altitude: Increase the altitude of all landmasses to differentiate from the sea.
- Resolution Adjustment: Change the resolution of the model for more detailed or simplified views.
- Seasons Simulation: Simulate seasons on the planet model.
- Atmosphere and Clouds: Add an atmosphere and clouds based on NASA satellite data.
- Free Camera Mode: View the model in a free camera mode for an immersive experience.
- Real-time Simulation: All changes and simulations happen in real-time.
- Additional Datasets: Includes hard-to-obtain datasets for trying out models of other planets.
- Save 3d models:Save the 3d model according to your preferences.
- Moons Simulation: Simulate moons orbiting the planets.
- Random Cloud Map Generator: Add a feature to generate random cloud maps.
- Coming Soon...
To get started with the project, follow these steps:
- C++ compiler
- raylib library
- Visual Studio Code (or any preferred IDE)
-
Clone the repository:
git clone https://github.com/vb8146649/PlanetSimulator_usingRaylib cd PlanetSimulator_usingRaylib
-
Install dependencies:
- Follow the instructions on the raylib website to install raylib.
- Ensure your C++ compiler is set up correctly.
- Make sure you have
raygui.h
and update it's location in thecommon.h
.
-
Build the project:
- Open the project in your IDE (e.g., Visual Studio Code).
- Build the project using the build tools provided by your IDE.
Run the executable generated after building the project. You will see a window with the 3D model of the planet.
- Use the controls to adjust the radius, mountain prominence, landmass altitude, and resolution.
- Toggle seasons and atmosphere to see the changes in real-time.
- Switch to free camera mode to explore the model from different angles.
To create models of other planets, you need to update the file locations in main.cpp
. There are four variables corresponding to topography, texture, initial file location for clouds, and initial file location for seasons.
-
Open
main.cpp
:- Locate the file
main.cpp
in your project directory and open it in your text editor or IDE.
- Locate the file
-
Update Variables:
- Find the following variables in
main.cpp
:std::string topographymap = "path/to/topography.png"; std::string texturemap = "path/to/texture.png"; std::string cloudmaploc = "path/to/clouds/cloud/"; std::string seasonsmaploc = "path/to/seasons/season/";
- Update these variables with the paths to your new planet data files. Ensure that the images for clouds and seasons are named in sequence (e.g., 1.png, 2.png) and use the correct file names to specify the ending and starting numbers.
- Find the following variables in
-
Ensure File Format:
- Use only png file formats for image and texture.
-
Ensure Numbered Filenames:
- Make sure that the image names for clouds and seasons are in numerical order. For example,
1.png
,2.png
, etc. The program will use these numbers to load the correct files.
- Make sure that the image names for clouds and seasons are in numerical order. For example,
-
Save and Rebuild:
- Save your changes to
main.cpp
and rebuild the project using your IDE's build tools.
- Save your changes to
The repository includes various datasets for different planets. These datasets are rare and hard to obtain, providing an opportunity to explore and model other planets besides Earth.
If you have any suggestions or improvements, feel free to create an issue or submit a pull request. Contributions are always welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
- raylib
- NASA for providing satellite data
Hope you enjoy exploring and simulating planets with this project! For any queries, feel free to reach out.