0% found this document useful (0 votes)
34 views22 pages

Bhumi Ka

This project aims to create a model of the Solar System using spheres for objects and images for textures, utilizing OpenGL for rendering and user interaction. The project involves coding in C with OpenGL, focusing on features like lighting, texture mapping, and user-friendly interfaces for celestial exploration. It includes a comprehensive report detailing the introduction, literature survey, requirements, design, implementation, and acknowledgments related to the project.

Uploaded by

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

Bhumi Ka

This project aims to create a model of the Solar System using spheres for objects and images for textures, utilizing OpenGL for rendering and user interaction. The project involves coding in C with OpenGL, focusing on features like lighting, texture mapping, and user-friendly interfaces for celestial exploration. It includes a comprehensive report detailing the introduction, literature survey, requirements, design, implementation, and acknowledgments related to the project.

Uploaded by

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

ABSTRACT

In this project, we strive to obtain a Model of the Solar System. The principle behind the working
of the project is that, we use spheres to create the objects and use images for the textures. We
achieve this by taking an image of .JPEG or .JPG form and use certain tools to obtain a True
vision Graphics Adapter File. This file format is widely used for texture mapping. Resizing is
done internally when this process occurs; we specify the width and the depth scaling during the
conversion.

We use this file to generate textures for the objects. The user-defined functions handle the image
loading and displaying of the texture is obtained using API of OpenGL. We use OpenGL for
rendering of the object. We achieve this by storing the textures in an array. This array contains
all the textures required for rendering the model. We make use of Lighting API of OpenGL to
make the model seem better. Menu list is created using the OpenGL API to display individual
objects separately. The model is provided with certain operations that can be performed by the
viewer, which is executed using the OpenGL API for keyboard operations. With all the data on
hand, we create a Model of the Solar System.

We make use of C with OpenGL for entire coding purpose along with some features of Windows.
The OpenGL Utility is a Programming Interface. We use light functions to add luster, shade and
shininess to graphical objects. The toolkit supports much more functionalities like multiple
window rendering, callback event driven processing using sophisticated input devices etc.
CONTENTS

Topics Page No

ACKNOWLEDGEMENT i

ABSTRACT ii

1. INTRODUCTION 01-03
1.1 computer graphics
1.2 OpenGL
1.3 Project goal
1.4 Scope

2. LITERATURE SURVEY 04-06

3. REQUIREMENT SPECIFICATION 07

3.1 Hardware requirements

3.2 Software requirements

4. DESIGN 08-10

5. IMPLEMENTATION 11-13

6. SNAPSHOTS 14

7. CONCLUSION 15

8. REFERENCES 16
GOVERNMENT OF KARNATAKA

DEPARTMENT OF TECHNICAL EDUCATION

GOVERNMENT ENGINEERING COLLEGE


DEVAGIRI, HAVERI-581110
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

MINI PROJECT REPORT ON

“SOLAR SYSTEM”

Submitted in the partial fulfillment for the degree of

BACHELOR OF ENGINEERING

IN

COMPUTER SCIENCE AND ENGINEERING

Submitted By

ANISHA F K 2GO21CS004

BHUMIKA S B 2GO21CS011

SINDHU G H 2GO21CS046

SOUMYA M M 2GO21CS047

Under The Guidance of

Prof. SHRUTHI T N

VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI


[2023-2024]
GOVERNMENT OF KARNATAKA

DEPARTMENT OF TECHNICAL EDUCATION

GOVERNMENT ENGINEERING COLLEGE DEVAGIRI, HAVERI


(Affiliated to Visvesvaraya Technological University)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

2023-2024

Certificate
This is to certify that the mini project work entitled “SOLAR SYSTEM” carried out by Anisha F
K(2GO21CS004), Bhumika S B(2GO21CS011), Sindhu G H (2GO21CS046) and Soumya M M
(2GO21CS047) are Bonafede students of Government Engineering College, Haveri in partial
fulfilment for the award of Bachelor of Engineering in Computer Science and Engineering of
the Visvesvaraya Technological University, Belagavi during the year 2023-2024. The mini project
report has been approved as it satisfies the academic requirements in report of mini project work
prescribed for the said Degree.

Signature Of Guide Signature Of HOD Signature of Principal

NAME OF EXAMINER Signature with Date

1……………………………………… 2………………………………………
ACKNOWLEDGEMENT

The same of contentment and elation that accomplishes the successful of completion of
our task would be incomplete without mentioning the names of the people who helped in
accomplishment of this Mini-Project, whose constant guidance, support and encouragement
resulted in its realization.

We would greatly mention the enthusiastic influence provided by Prof. Shruthi T N


Project guide, for their ideas and co-operation showed on us during venture and making this
project a great success.

We are also thankful to Prof . Nithyanand HOD of the Department of Computer Science
andEngineering, for his co-operation and encouragement at all moments of our approach.

We take this opportunity to the Principal, Dr. Jagadeesh B Kori GEC, HAVERI, for

beingkind enough to provide us an opportunity to work on a project in this institution.

We also extend our thanks to all the faculty members of Computer Science Department,
GECHaveri, who have encouraged us throughout the course of bachelor of engineering.

Anisha F K 2GO21CS004

Bhumika S B 2GO21CS011

Sindhu G H 2GO21CS046

Soumya M M 2GO21CS047
Solar System

CHAPTER-1

INTRODUCTION

1.1 Computer Graphics

Graphics provides one of the most natural means of communicating with a computer, since
our highly developed 2D and 3D pattern recognition abilities allow us to perceive and process pictorial
data rapidly and efficiently. Interactive computer graphics is the most important means of producing
pictures since the invention of photography and television. It has the added advantage that, with the
computer, we can make pictures not only of concrete real world objects but also of abstract, synthetic
objects, such as mathematical surfaces and of data that have no inherent geometry, such as survey
results.

1.2 OpenGL

OpenGL (Open Graphics Library) is a standard specification defining a cross language cross
platform API for writing applications that produce 2D and 3D computer graphics. The interface
consists of over 250 different function calls which can be used to draw complex 3D scenes from simple
primitives. OpenGL was developed by Silicon Graphics Inc. (SGI) in 1992 and is widely used in CAD,
virtual reality, scientific visualization, information visualization and flight simulation. It is also used
in video games, where it competes with direct 3D on Microsoft Windows Platforms. OpenGL is
managed by the non profit technology consortium, the Khronos group Inc.

OpenGL serves two main purposes :


➢ To hide the complexities of interfacing with different 3D accelerators, by presenting
programmer with a single, uniform API
➢ To hide the differing capabilities of hardware platforms , by requiring that all
implementations support the full OpenGL feature set.
OpenGL has historically been influential on the development of 3D accelerator, promoting a base
level of functionality that is now common in consumer level hardware:
➢ Rasterized points, lines and polygons are basic primitives.
➢ A transform and lighting pipeline .

Dept. Of CSE 2023-2024 1


Solar System

➢ Z buffering .
➢ Texture Mapping.
➢ Alpha Blending.

1.2.1 OpenGL Graphics Architecture :

Figure 1.1 Opengl Graphics Architecture

Display Lists : All data, whether it describes geometry or pixels, can be saved in a display list for
current or later use. When a display list is executed, the retained data is sent from the display list just as
if it were sent by the application in immediate mode.

Evaluators : All geometric primitives are eventually described by vertices. Parametric curves and
surfaces may be initially described by control points and polynomial functions called basis functions.

Per Vertex Operations : For vertex data, next is the "per-vertex operations" stage, which converts the
vertices into primitives. Some vertex data are transformed by 4 x 4 floating-point matrices.

Dept. Of CSE 2023-2024 2


Solar System

Primitive Assembly : Clipping, a major part of primitive assembly, is the elimination of portions of
geometry which fall outside a half space, defined by a plane.

Pixel Operation: While geometric data takes one path through the OpenGL rendering pipeline, pixel
data takes a different route. Pixels from an array in system memory are first unpacked from one of a
variety of formats into the proper number of components. Next the data is scaled, biased, and processed
by a pixel map. The results are clamped and then either written into texture memory or sent to the
rasterization step.

Rasterization: Rasterization is the conversion of both geometric and pixel data into fragments. Each
fragment square corresponds to a pixel in the framebuffer. Color and depth values are assigned for each
fragment square.

Fragment Operations : Before values are actually stored into the framebuffer, a series of operations
are performed that may alter or even throw out fragments. All these operations can be enabled or disabled.

1.3 Project Goal


The aim of this project is to show the shadow implementation using OPENGL which include
Movement, Light properties also transformation operations like translation, rotation, scaling etc on
objects. The package must also have a user friendly interface .

1.4 Scope
It is developed in ECLIPSE. It has been implemented on UBUNTU platform. The 3-D
graphics package designed here provides an interface for the users for handling the display and
manipulation of Celestial Exploratory. The Keyboard is the main input device used.

Dept. Of CSE 2023-2024 3


Solar System

CHAPTER-2
LITERATURE SURVEY
SOLAR SYSTEM

The Solar System consists of the Sun and the astronomical objects bound to it by gravity, all
of which formed from the collapse of a giant molecular cloud approximately 4.6 billion years ago. Of
the many objects that orbit the Sun, most of the mass is contained within eight relatively solitary
planets[e] whose orbits are almost circular and lie within a nearly flat disc called the ecliptic plane.
The four smaller inner planets, Mercury, Venus, Earth and Mars, also called the terrestrial planets, are
primarily composed of rock and metal. The four outer planets, the gas giants, are substantially more
massive than the terrestrials. The two largest, Jupiter and Saturn, are composed mainly of hydrogen
and helium; the two outermost planets, Uranus and Neptune, are composed largely of ices, such as
water, ammonia and methane, and are often referred to separately as "ice giants".

Sun

The Sun is the Solar System's star, and by far its chief component. Its large mass (332,900 Earth
masses) produces temperatures and densities in its core great enough to sustain nuclear fusion, which
releases enormous amounts of energy, mostly radiated into space as electromagnetic radiation,
peaking in the 400–700 nm band we call visible light. The Sun is classified as a type G2 yellow dwarf,
but this name is misleading as, compared to the majority of stars in our galaxy, G2 yellow dwarf, but
this name is misleading as, compared to the majority of stars in our galaxy, the Sun is rather large and
bright. Stars are classified by the Hertzsprung - Russell diagram, a graph that plots the brightness of
stars with their surface temperatures. Generally, hotter stars are brighter. Stars following this pattern
are said to be on the main sequence, and the Sun lies right in the middle of it.

Mercury

Mercury is the closest planet to the Sun and the smallest planet in the Solar System (0.055 Earth
masses). Mercury has no natural satellites, contraction early in its history. Its relatively large iron core
and thin mantle have not yet been adequatelyinclude that its outer layers were stripped off by a giant
impact, and that it was prevented from fully accreting by the young Sun's energy.

Dept. Of CSE 2023-2024 4


Solar System

Venus

Venus (0.7 AU from the Sun) is close in size to Earth, (0.815 Earth masses) and like Earth, has a
thick silicate mantle around an iron core, a substantial atmosphere and evidence of internal geological
activity. However, it is much drier than Earth and its atmosphere is ninety times as dense. Venus has
no natural satellites. It is the hottest planet, with surface temperatures over 400 °C, most likely due to
the amount of greenhouse gas in the atmosphere. No definitive evidence of current geological activity
has been detected on Venus, but it has no magnetic field that would prevent depletion of its substantial
atmosphere, which suggests that its atmosphere is regularly replenished by volcanic eruptions.

Earth

Earth (1 AU from the Sun) is the largest and densest of the inner planets, the only one known to
have current geological activity, and is the only place in the universe where life is known to exist. Its
liquid hydrosphere is unique among the terrestrial planets, and it is also the only planet where plate
tectonics has been observed. Earth's atmosphere is radically different from those of the other planets,
having been altered by the presence of life to contain 21% free oxygen. It has one natural satellite, the
Moon, the only large satellite of a terrestrial planet in the Solar System.

Mars

Mars (1.5 AU from the Sun) is smaller than Earth and Venus (0.107 Earth masses). It possesses an
atmosphere of mostly carbon dioxide with a surface pressure of 6.1 millibars (roughly 0.6 percent that
of the Earth's). Its surface, peppered with vast volcanoes such as Olympus mons and rift valleys such
as Valles Marineris, shows geological activity that may have persisted until as recently as 2 million
years ago. Its red colour comes from iron oxide(rust) in its soil. Mars has two tiny natural satellites
(Dimos and Phobos) thought to be captured asteroids.

Dept. Of CSE 2023-2024 5


Solar System

Jupiter

Jupiter (5.2 AU), at 318 Earth masses, is 2.5 times the mass of all the other planets put together. It
is composed largely of hydrogen and helium. Jupiter's strong internal heat creates a number of semi-
permanent features in its atmosphere, such as cloud bands and the Great Red Spot. Jupiter has 63
known satellites. The four largest, Ganymede, Callisto, Io, and Europa, show similarities to the
terrestrial planets, such as volcanism and internal heating.Ganymede, the largest satellite in the Solar
System, is larger than Mercury.

Saturn

Saturn (9.5 AU), distinguished by its extensive ring system, has several similarities to Jupiter, such
as its atmospheric composition and magnetosphere. Although Saturn has 60% of Jupiter's volume, it
is less than a third as massive, at 95 Earth masses, making it the least dense planet in the Solar System.
The rings of Saturn are made up of small ice and rock particles.

Uranus

Uranus (19.6 AU), at 14 Earth masses, is the lightest of the outer planets. Uniquely among the
planets, it orbits the Sun on its side; its axial tilt is over ninety degrees to the ecliptic. It has a much
colder core than the other gas giants, and radiates very little heat into space. Uranus has 27 known
satellites, the largest ones being Titania, Oberon, Umbriel, Ariel and Miranda.

Neptune

Neptune (30 AU), though slightly smaller than Uranus, is more massive (equivalent to 17 Earths)
and therefore more dense . It radiates more internal heat, but not as much as Jupiter or Saturn. Neptune
has 13 known satellites. The largest, Triton, is geologically active, with geysers of nitrogen. Triton is
the only large satellite with a retrograde orbit. Neptune is accompanied in its orbit by a number of
minor planets, termed Neptune Trojans, that are in 1:1 resonance with it.

Dept. Of CSE 2023-2024 6


Solar System

CHAPTER-3
REQUIREMENT SPECIFICATION

3.1 HARDWARE REQUIREMENTS:

• 128 MB of RAM, 256 MB recommended.

• 110 MB of hard disk space required, 40 MB additional hard disk space required for installation
(150 MB total).

3.2 SOFTWARE REQUIREMENTS:


This solar system simulator has been designed for UBUNTU. OpenGL libraries are used and
hence Codeblocks is required.

Development Platform: Windows


Language : C++
Tool : Codeblocks
Library : OpenGL

Dept. Of CSE 2023-2024 7


Solar System

CHAPTER 4

DESIGN

The project “CELESTIAL EXPLORATORY” is meant as a source of recreation where one


can sit in front of the computer and have the vision of a plant in space. This package is developed to
provide opportunities to climb aboard the earth for the adventure of the lifetime. It is aimed to create
starts and planets and give constant motion to these objects.
The sun and its family of eight planets are imagined to be placed in a background of bright
twinkling starts along with a comet in constant motion. the lighting effect in the background appears
as though the planet is rotating and revolving around the sun in the galaxy. The most important aspect
of this project is that ,one can sit back ,relax and watch constantly occurring motion of the planet and
the stars just depicting the fact that “as passengers of the earth our voyage never ends!”

This chapter documents a detailed description of the implementation of our project. We have
incorporated several inbuilt OpenGL function in this project. The following code snippet enables the
easy rendering of solid sphere with different colors and makes them to rotate and translate. {
.....
glRotatef(s. . .); glTranslatef(.
. .); glRotatef(. . .);
glColor3f(. . .);
glutSolidSphere(. . .);
.....
}
The header files used are :
1. #include<stdlib.h>:This is C library function for standard input and output.

2. #include<GL/glut.h>:This header is included to read the glut.h, gl.h and glu.h.

3. #include<math.h>:This is a C library function for performing certain mathematical operations.

Dept. Of CSE 2023-2024 8


Solar System

1. glClearColor(. . . ):

Whenever we wish to draw a new frame, the window must be cleared by using the
4-dimensional(RGBA)color system.The above function must be enabled to make the
window on screen solid and white.
2. glshadeModel(. . .):

To enable the smooth shading we must set the shade as follows


glShadeModel(GL_SMOOTH);
3. glEnable(. . .):

The z_buffer is one of the buffers that make up the frame buffer.The depth buffer must be
cleared whenever we wish to redraw the display.This is done as follows
glEnable(GL_DEPTH_TEST);
4. glMaterial(. . .):

We can specify different material properties for the front and back faces of a surface through
the following functions glMaterialfv(GLenum face, GLenum type,GLfloat
*pointer_to_array); glMaterialfv(GLenum face,GLenum type,GLfloat value);
5. glLight(. . .):

This function is used to enable a light source.The following function specifies the required
vector and scalar parameters to enable a light source.
glLightfv(GLenum source,GLenum parameter,GLfloat*pointer_to_arrary))
glLightf(GLenum source,GLenum parameter,GLfloat value)
6. glColorMaterial(. . .):

This function is used to change a single material property.

myinit();
Here we initialize the color buffer, set the point size and set window co-ordinate
values.

Dept. Of CSE 2023-2024 9


Solar System

display();
This function creates and translates all the objects in a specified locatioN in a particular order.

Translated(. . .);
In this function the variables are components of displacement vector.

glutPostRedisplay();
It ensures that display will be drawn only once each time program goes through the
event loop.

glutMainLoop();
This function whose execution will cause the program to begin an event processing loop.

User Interface:
Keyboard Based Interface
Using the keyboard user can make the planets to rotate on their own axis and revolve round the Sun.
The stars are made to twinkle and the Comet is made to revolve round the Sun.
The keys m, v, e, r, j, s, u, n are used to rotate the planets.

The keys M, V, E, R, J, S, U, N are used to revolve the planets around the Sun.

The key z rotates the sun, B gives both the rotation and revolution of the planets around the rotating
Sun with a Comet revolution and Stars twinkle.

Pressing the key A revolves all the planets and comet and the key a rotates all the planets around the
rotating Sun with Stars twinkling in the background.
The key b is used to make the stars twinkle and c for the revolution of the Comet.

Mouse Interface
Using the mouse user can make the planets to rotate and revolve round the Sun and Comet
to revolve round the Sun.
Left Button: Rotates and revolves the planets and Comet in anticlockwise direction.
Middle Button: Rotates and revolves the planets and Comet in clockwise direction.
Right Button: Rotates and revolves the planets and Comet in clockwise direction.

Dept. Of CSE 2023-2024 10


Solar System

CHAPTER 5
IMPLEMENTATION

The implementation of the different objects in this project is divided into different module.

MODULE 1:

SUN:
The sun is drawn by using the following lines of code.
{ glPushMatrix(); glRotatef(…);
glLightfv(GL_LIGHT0,GL_POSITION,position);
glDisable(GL_LIGHTING); glutSolidSphere(…);
glPopMatrix();
}

MODULE 2:

PLANETS WITH RINGS:


The planets Saturn and Uranus are the 2 planets in our solar system with rings. They are implemented
using the following codes.
{ glPushMatrix(); glRotatef(…); glTranslatef(…);
gluLookAt(0.0,10.0,2.0,1.0,0.0,0.0,0.0,0.0,1.0);
glutSolidSphere(…); int i=0;
glBegin(GL_QUAD_STRIP); for(i=0;i<=360;i++)
{
glVertex3f(sin(i*3.1416/180)*0.5,cos(i*3.1416/180)*0.5,0);
glVertex3f(sin(i*3.1416/180)*0.7,cos(i*3.1416/180)*0.7,0); } glEnd(); glPopMatrix();
}

Dept. Of CSE 2023-2024 11


Solar System

MODULE 3:

EARTH:
The earth is drawn along with its natural satellite, moon which revolve round the earth. The following
lines of codes are used to implement the earth and the moon.

{ glPushMatrix(); glRotatef(…);
glTranslatef(…); glRotatef(…);
glColor3f(…); glutSolidSphere(…); /*draw
planet earth*/ glRotatef(…); glTranslatef(…);
glColor3f(…); glutSolidSphere(…); /*draw
moon*/ glPopMatrix();
}

MODULE 4:

OTHER PLANETS:
The remaining planets are Mercury, Venus, Mars, Jupiter and Neptune. All these planets are
implemented using the same set of codes by changing the values and colors.

{ glPushMatrix();
glRotatef(…);
glTranslatef(…);
glRotatef(…);
glColor3f(…);
glutSolidSphere(…);
/*draw smaller
planet mercury*/
glPopMatrix();
}

Dept. Of CSE 2023-2024 12


Solar System

MODULE 5:

STARS:
The stars are implemented in the background using the following lines of codes.
{ glPushMatrix(); glTranslatef(…);
gluLookAt(0.0,10.0,0.0,1.0,0.0,0.0,0.0,0.0,3.0);
glRotatef(…); glScalef(…); glColor3f(…);
glutSolidSphere(…); glPopMatrix();
}

MODULE 6:

COMET:
The comet is made to revolve round the sun. The following codes are used to implement the
comet. { glPushMatrix(); glRotatef((GLfloat)c,6.0,-14.0,-6.0); glTranslatef(5.0,3.0,-1.0);
glScalef(0.60,0.0,2.5); glColor3f(7.5,9.5,2.0); glutSolidSphere(0.2,12,6); /*draw comet*/
glPopMatrix();
}

Dept. Of CSE 2023-2024 13


Solar System

CHAPTER 6

SNAPSHOTS

Dept. Of CSE 2023-2024 14


Solar system

CHAPTER -7

CONCLUSION

The code we have implemented for our project is working well to the best of our knowledge.
In this project the planets, sun, comet and starts act as per the users’s command.This project will serve
as a delight to the eyes of the night sky watchers.This project is both informative and entertaining .
This project provided an opportunity to learn the various concepts of the subject in detail and provided
us a platform to express our creativity and imagination come true.
It can be concluded that the project “Celestial Exploratory” is a thing of beauty that will
remain a joy forever in our hearts.

Dept. of CSE 2023-2024 15


Solar system
BIBLIOGRAPHY

1. Edward Angel: Interactive Computer Graphics: A Top-Down Approach with 5th Edition,
Addison-wesley,2008.

2. James D Foley, Andries Van Dam, Steven K Feiner, Jhon F Hughes: - Computer Graphics,
Addison-Wesley 1997.

3. Yashavanth Kanetkar, ”Graphics under opengl”, Published by BPB Publications.

4. Athul P.Godse, “Computer Graphics”,Technical Publications Pune, 2nd Revised Edition.

5. James D.foley, Andries Van Dam, Steven K.Feiner,


John F.Hughes, “Computer Graphics Principle & Practice” Published by
Pearson Education Pte.ltd, 2nd Edition.

Dept. of CSE 2023-2024 16


Solar system

REFERENCES

8.1 HYPERLINKS

• www.w3schools.com

• www.in.php.net

• www.en.wikipedia.org

• www.hotscripts.com

• www.apache.org

• www.mysql.com

8.2 BOOK REFERENCES

[1] Database System Models, Languages, Ramez Elmasri and Sham Kant B. Navathe, 7th

Edition, 2017 Pearson.

[2] Fundamentals of Web Development, Randy Connolly and Ricardo Hoar, First
Impression, 2016 Pearson

Dept. of CSE 2023-2024 17

You might also like