Simulation On 3d Solar System
Simulation On 3d Solar System
By Saima Islam
Id:21104022
Date: 31st Jan 2025
Lab Project of Computer Graphics
To Miss Ayesha Binte Mostofa
What is it?
A gravitationally bound system consisting of the Sun and all the celestial bodies that orbit it,
including planets, moons, asteroids, comets, and other space debris.
Main Components of the Solar System:
1. The Sun – A massive star at the center that provides light and heat.
2. Planets (in order from the Sun):
1. Mercury – Smallest and closest to the Sun.
2. Venus – Thick atmosphere, very hot.
3. Earth – The only planet known to support life.
4. Mars – The "Red Planet," with signs of ancient water.
5. Jupiter – Largest planet, with a Great Red Spot storm.
6. Saturn – Famous for its beautiful rings.
7. Uranus – Rotates on its side, has a blue-green color.
8. Neptune – Farthest, known for strong winds.
How does the code work ?
This program brings a mini solar system to life using OpenGL! 🌍✨
1️⃣Sets up the space—defines colors, depth, and camera angle.
2️⃣Draws the Sun, planets, and orbits—each planet has its own size and
color.
3️⃣Moves planets realistically—using math to place them in circular orbits.
4️⃣Animates smoothly—planets spin at different speeds like in real life.
5️⃣Keeps running forever—constantly refreshing the scene for a smooth
experience.
In short, it's like a tiny universe on your screen, where planets keep
spinning forever! 🚀🔭
Part f: The init function configures the basic
settings for the OpenGL rendering
environment:
This functions are used to setup
OpenGL environment for graphics
rendering for preparing the scene to
render properly
📝 What it does:
1. Calculates the planet's position in space based on its orbit and angle.
2. Translates OpenGL to that position.
3. Draws the planet as a sphere with a given radius and color.
4. Restores the matrix state to avoid affecting other objects in the scene.
Part•Calculates the Saturn's position in its orbit.
d: •Translates the drawing cursor to that position.
•Rotates the ring to make it appear correctly around Saturn.
•Draws the ring as a 2D circle, adjusting its size and thickness
Part
e:
•Clears the screen and
sets up the camera for
viewing.
Thanking you
Any Questions?