0% found this document useful (0 votes)
41 views16 pages

Simulation On 3d Solar System

The document outlines a lab project on simulating a 3D solar system using OpenGL, detailing the main components such as the Sun and planets, along with their characteristics. It explains the code's functionality, including setting up the OpenGL environment, calculating planetary positions, and animating their movements. The project aims to create a continuous and realistic representation of the solar system on screen.

Uploaded by

nasrin.akter2ne1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views16 pages

Simulation On 3d Solar System

The document outlines a lab project on simulating a 3D solar system using OpenGL, detailing the main components such as the Sun and planets, along with their characteristics. It explains the code's functionality, including setting up the OpenGL environment, calculating planetary positions, and animating their movements. The project aims to create a continuous and realistic representation of the solar system on screen.

Uploaded by

nasrin.akter2ne1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

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

•Enables depth testing for proper 3D


rendering.

•Sets up a perspective view.

•Prepares the background and object


transformations.
The init function configures the basic settings for the OpenGL rendering
Part a: environment:
This functions are used to setup OpenGL environment for graphics
rendering for preparing the scene to render properly
•Enables depth testing for proper 3D rendering.
•Sets up a perspective view.
•Prepares the background and object transformations.
Part b.  Discuss the purpose of the code used here :
 Initializes OpenGL settings for 3D rendering.
 Stores the rotation angles of the planets (so they can move).
 Drawing orbits for the planets.
Part c:

📝 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.

•Draws the Sun and its


orbits.

•Positions and draws


the planets according
to their orbital
parameters.

•Draws Saturn's rings


and properly positions
them.

•Swaps the buffers to


show the updated scene.
Part e:
•Updates the angle of each planet
to simulate orbit movement.

•Redraws the scene to reflect the


new positions.

•Schedules the next update in


16 milliseconds for continuous
animation.
The init function configures the basic settings for the OpenGL rendering
Part a: environment:
This functions are used to setup OpenGL environment for graphics
rendering for preparing the scene to render properly
•Enables depth testing for proper 3D rendering.
•Sets up a perspective view.
•Prepares the background and object transformations.
Part f:
•Initializes GLUT and sets up
the display settings.

•Creates a window and


prepares OpenGL with init().

•Sets up functions for drawing


the scene (display) and
updating the simulation
(update).

•Enters the main loop where it


keeps rendering and updating
the simulation until the
program is closed.
The END ..

Thanking you

Any Questions?

You might also like