CG Mini Project Report
CG Mini Project Report
A PROJECT REPORT
on
“ WORKING OF A SATELLITE ”
Submitted by
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575 007
(An Autonomous Institution)
2022 - 23
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575 007
(An Autonomous Institution)
CERTIFICATE
———————————– ———————————–
Mrs. Bhavana A S Dr.Nagesh H R
Assistant Professor HOD
Department of CSE Department of CSE
SCEM, Mangaluru SCEM, Mangaluru
Signature of Examiner’s
1. . . . . . . . . . . . . . . . . . . . . .
2. . . . . . . . . . . . . . . . . . . . . .
Abstract
The main aim of this Mini Project is to illustrate the working concepts of a Satellite
using OpenGL. A Satellite is an artificial object placed into orbit by human efforts,
distinguishing it from natural satellites like the Moon. Satellites serve various purposes,
including military and civilian Earth observation, communications, navigation, weather
monitoring, and research.
During the project, the network experienced a ”congestion collapse” due to excessive
packet loss, resulting in a significantly reduced throughput. To enhance user interaction,
input devices such as the mouse and keyboard were utilized.
To create a comprehensive network setup and facilitate understanding of Congestion
Control, SolidCube objects were employed. Different colors were assigned to distinguish
between various objects, while font family was used to indicate their names. The inclusion
of a menu made the program more interactive.
In this project, a small SolidCube represented the data, simulating its transfer from a
source to a destination. These visual elements and features combined to provide a visual
representation of satellite operation using OpenGL.
i
Acknowledgement
Before we get in-depth with the project, we want to include few expressions of appreciation
for the people who have been a piece of this project from its inception.
We hereby take this chance to include a special note of much obliged for Mrs Bhavana
A S,, Assistant Professor, and Department of Computer Science who guided us in our
project.
We sincerely thank Dr. Rajesha S, Principal, Sahyadri College of Engineering & Man-
agement,Sahyadri College of Engineering & Management,who have always been a great
source of inspiration.
We would also like to thank all our non-teaching staffs who also were very much supportive
to us in building this project.
Finally, yet importantly, We express our heartfelt thanks to our parents, family & friends
for their wishes and encouragement throughout the work.
ii
Table of Contents
Abstract i
Acknowledgement ii
Table of Contents iv
List of Figures v
1 Introduction 1
1.1 Introduction to Computer Graphics . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Introduction to OpenGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Overview of project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 REQUIREMNET SPECIFICATION 5
2.1 Project Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 System Design 7
3.1 Flow Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Interaction with program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4 IMPLEMENTATION 9
4.1 Implementation of OpenGL Built-In Functions . . . . . . . . . . . . . . . . 9
4.2 Implementation of User-Defined Functions . . . . . . . . . . . . . . . . . . 10
5 RESULT 26
5.1 Snapshot-1: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2 Snapshot-2: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3 Snapshot-3: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.4 Snapshot-4: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
iii
5.5 Snapshot-5: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6 CONCLUSION 29
References 30
iv
List of Figures
3.1 Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
v
Chapter 1
Introduction
• The sub-filed of computer science which studies methods for digitally synthesizing
and manipulating visual content, see study of computer graphics.
Today, computer graphics is widespread. Such imagery is found in and on television, news-
paper, weather reports, and in variety of medical investigation and surgical procedures. A
well-constructed graph can present complex statistics in a form that is easier to understand
and interpret. In the media ”such graphs are used to illustrate papers, report,thesis”, and
other presentation material.
Many tools have been developed to visualize data. Computer generated imagery can be
categorized into several different types: two dimensional (2D), three dimensional (3D),
and animated graphics. As technology has improved, 3D computer graphics have become
more common, but 2D computer graphics are still widely used. Computer graphics have
emerged as a sub-filed of computer science which studies methods for digitally synthesiz-
ing and manipulating visual content. Over the past decade, other specialized fields have
been developed like information visualization, and scientific visualization more concerned
with the ”the visualization of three dimensional phenomena (architecture, meteorological,
1
Working of a Satellite Chapter 1
medical. Biological, etc, where the emphasis is on realistic rendering of volumes, surfaces,
illumination sources, and so forth, perhaps with a dynamic (time) component”. Computer
graphics is responsible for displaying art and image data effectively and meaningfully to
the consumer. It is also used for processing image data received from the physical world.
Computer graphics development has had a significant impact on many types of media and
revolutionized animation, movies, advertising, video games, and graphic design in general.
Figure 1.1 shows the organization of the OpenGL Library. It is possible to build a sophis-
ticated library on top of OpenGL that provides additional features. The OpenGL Utility
Library (GLU) is a standard part of every OpenGL implementation and offers various
modeling features, including quadric surfaces and NURBS curves and surfaces. Another
higher-level, object-oriented toolkit called Open Inventor is built on top of OpenGL and is
available separately for many OpenGL implementations. Additionally, GLUT is a utility
toolkit for writing OpenGL programs that is independent of the underlying windowing sys-
tem. It provides a simple API for creating windows and contains methods for describing
and rendering quadric curves and surfaces.
1.4 Applications
• Education and Training: The ”Working of a Satellite” simulation project serves
as an interactive educational tool, providing a visual representation of satellite oper-
ations and communication principles. It aids in enhancing understanding and knowl-
edge acquisition for students and trainees studying satellite communication systems.
REQUIREMNET SPECIFICATION
The functional requirements of the project include the use of the OpenGL utility toolkit,
accessed through the header file ”GL/glut.h”. This header file, along with the necessary
standard header files, is essential for the proper execution of the project. To run the
program, a basic C-compatible version of Code Blocks or a Linux-based platform such as
Ubuntu is sufficient. These requirements ensure that the project can utilize the OpenGL
functionality and be executed on compatible development environments or operating sys-
tems.
Non-functional Requirements:
The non-functional requirements of the project encompass various aspects. Firstly, the
software should prioritize efficient memory usage through dynamic memory allocation.
This approach minimizes memory consumption and enhances overall performance. Addi-
tionally, the software should incorporate robust input validation to prevent acceptance of
incorrect inputs, ensuring data integrity. Lastly, the project should produce desired and
high-quality outputs, meeting standards of accuracy, visual appeal, and usability, thereby
enhancing the user experience and understanding of satellite communication concepts.
5
Working of a Satellite Chapter 2
• Monitor,Keyboard, Mouse
• AM-512MB(minimum)
• OpenGL
• DevC++ Software
System Design
7
Working of a Satellite Chapter 3
• Start: The flowchart begins at the ”Start” point, indicating the starting point of
the process.
• Introduction Page: After starting, the flow moves to the ”Introduction Page”
screen. This screen contains introductory information and instructions for the project.
• Press Enter: If the user presses the ”Enter” key, the flow moves to the ”Interaction
Key Menu” screen. This indicates that pressing Enter initiates a transition to the
menu screen of the project.
• Press S/s: If the user presses the ”S/s” key, the flow moves to the ”First Scene”
screen. This indicates that pressing ”S/s” initiates a transition to the first scene of
the project. In the first scene satellite revolves around the earth.
• Press t: If the user presses the ”t” key, the flow moves to the ”Second Scene”
screen. This indicates that pressing ”t” initiates a transition to the second scene of
the project. In the second scene data signals get transmitted. In the second scene
the flow offers two options:
– Start: If the data signals transmission has not been started, then pressing ”t”
will start the transmission.
– Stop: If the data signals transmission has been started, then pressing ”t” will
pause the transmission.
• Press Q/q: If the user presses the ”Q/q” key, the flow ends the scene. This means
that pressing ”Q/q” terminates the current scene by closing the program.
IMPLEMENTATION
• glutMainLoop(): Starts the main loop, which continuously renders and updates
the scene.
• glViewport(): Sets up the viewport, defining the portion of the window where the
rendering will occur.
9
Working of a Satellite Chapter 4
• glTranslatef(): Translates or moves the rotation center from one point to another
in three dimensions.
//control waves
static double w1=0,w2=0,w3=0;
static bool transmit=false;
void *font;
void *currentfont;
void satellite(){
glRotatef(60,1,0,0);
//body
glPushMatrix();
glColor3f(0.2,0.2,0.2);
glScaled(1,0.6,1);
glTranslatef(3.0,0,0.0);
glutSolidCube(0.4);
glPopMatrix();
//Solar Panels
glPushMatrix();
glColor3f(0.3,0.3,0.3);
glTranslatef(3,0,0.0);
//glRotatef(45,1,0,0);
glScaled(3.7,0.0,1);
glutSolidCube(0.4);
glPopMatrix();
glPushMatrix();
glColor3f(0.2,0.1,0.1);
glTranslatef(3.0,0,-0.4);
glScaled(0.5,0.5,0.5);
glutSolidSphere(0.3,50,50);
glPopMatrix();
glPushMatrix();
glColor3f(0.2,0.2,0.1);
glTranslatef(3.0,0,0.4);
glScaled(0.4,0.4,0.3);
glutSolidTorus(0.3,0.2,20,20);
glPopMatrix();
// Second Screen
void sat2(double ang)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-13.0f);
glRotatef(ang,0.0f,1.0f,0.0f);
//earth
glPushMatrix();
glColor3f(0.3,0.6,1);
//glScaled(0.8,0.04,0.8);
//glTranslatef(0.0,0,0.0);
glutSolidSphere(2.0,50,50);
glPopMatrix();
satellite();
glFlush();
glutSwapBuffers();
}
//Dish on top
glPushMatrix();
glColor3f(1,1,0);
glTranslatef(x1,y1+1.8,z1);
glRotatef(60,1,0,0);
glScaled(0.5,1.5,0.5);
glutSolidCone(0.5,1,20,20);
glPopMatrix();
//windows
glPushMatrix();
glColor3f(0.1,0,0);
glTranslatef(x1-0.2,y1+0.7,z1);
glScaled(0.5,0.5,0.5);
//glutSolidCube(.3);
for(float j=-3;j<1.5;j+=.8)
{
for(float i=0;i<1;i+=0.8)
{
glPushMatrix();
glTranslatef(i,j,1);
glutSolidCube(0.4);
glPopMatrix();
}
}
glPopMatrix();
}
void waves(){
glPushMatrix();
glTranslatef(0,1,0);
glScaled(0.05,0.5,0.1);
glutSolidCube(0.5);
glPopMatrix();
glPushMatrix();
glRotatef(-8,0,0,1);
glTranslatef(0.01,1,0);
glScaled(0.05,0.5,0.1);
glutSolidCube(0.5);
glPopMatrix();
glPushMatrix();
glRotatef(8,0,0,1);
glTranslatef(-0.01,1,0);
glScaled(0.05,0.6,0.1);
glutSolidCube(0.5);
glPopMatrix();
}
void sat1(){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-13.0f);
//glRotatef(x,0.0f,1.0f,0.0f);
//Moon
glPushMatrix();
glColor3f(1,1,1);
glTranslatef(-3.8,2.8,0);
glScaled(0.5,0.5,0.1);
glutSolidSphere(0.6,50,50);
glPopMatrix();
//Earth
glPushMatrix();
glColor3f(0.2,0.2,1);
glTranslatef(0,-12,0);
//glScaled(0.8,0.04,0.8);
glutSolidSphere(10.0,50,50);
glPopMatrix();
//Building Center
glPushMatrix();
glColor3f(0,1,1);
glRotatef(10,1,0,0);
building(1.2,-1.2,3.2);
glPopMatrix();
//Building left
glPushMatrix();
glColor3f(0,1,1);
glRotatef(5,0,0,1);
building(-3.8,-1.2,0);
glPopMatrix();
//signal
glPushMatrix();
glColor3f(0,0,1);
if(transmit){
glRotatef(-25,0,0,1);
glTranslatef(-1.25,-1.6+w1,0);
}
else glTranslatef(1,20,3.3);
waves();
glPopMatrix();
//Main Dish
//Tower
glPushMatrix();
glColor3f(1,1,1);
glTranslatef(-1,-2,4);
glRotatef(270,1,0,0);
glScaled(1.0,1,2.0);
glutWireCone(0.5,1,4,10);
glPopMatrix();
//Dish
glPushMatrix();
glColor3f(1,1,1);
glTranslatef(-1.08,0.2,3);
glRotatef(60,1,0,0);
glScaled(0.7,1.3,0.7);
glutSolidCone(0.4,0.5,20,20);
glPopMatrix();
//Building right
glPushMatrix();
glColor3f(0,1,1);
glRotatef(-5,0,0,1);
building(3.8,-1.2,0);
glPopMatrix();
//Saltellite
glPushMatrix();
glTranslatef(-3,3.0,0);
satellite();
glPopMatrix();
//stars
glPointSize(5);
for(int j=0;j<100;j++)
{
for(int i=0;i<100;i++)
{
rx[j]=rand()/500;
ry[i]=rand()/500;
glBegin(GL_POINTS);
glColor3f(0,2,2);
glVertex3f(-6+rx[j],ry[i],-5);
glEnd();
}
}
glPushMatrix();
//glScaled(1.1,2.0,0.1);
glTranslatef(0.0,0.0,-2.0);
setFont(GLUT_BITMAP_TIMES_ROMAN_24);
glColor3f(1,1,1);
drawstring(1,3.7,-1.0,"Satelitte");
setFont(GLUT_BITMAP_TIMES_ROMAN_24);
glColor3f(1,1,1);
drawstring(-4.4,.5,-1.0,"Reciever");
setFont(GLUT_BITMAP_TIMES_ROMAN_24);
glColor3f(1,1,0);
drawstring(0,-2,7,"Reciever");
setFont(GLUT_BITMAP_TIMES_ROMAN_24);
glColor3f(1,1,1);
drawstring(-1.5,-1,-1.0,"Transmitter");
setFont(GLUT_BITMAP_TIMES_ROMAN_24);
glColor3f(1,1,1);
drawstring(3.2,1,3,"Reciever");
glPopMatrix();
glFlush();
glutSwapBuffers();
}
// Third Screen
void sat3(double ang)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-13.0f);
glRotatef(ang,0.0f,1.0f,0.0f);
//earth
glPushMatrix();
glColor3f(0.3,0.6,1);
//glScaled(0.8,0.04,0.8);
//glTranslatef(0.0,0,0.0);
glutSolidSphere(2.0,50,50);
glPopMatrix();
satellite();
glFlush();
glutSwapBuffers();
}
void e()
{
x-=0.07;
sat2(x);
}
void s()
{
x-=0.07;
sat2(x);
}
void S()
{
x += .07;
if(transmit)
{
if(w1<=4.2)
w1+=0.01;
if(w1>=2.5 && w2<=6.9)
w2+=0.01;
if(w1>=2.5 && w3<=5)
w3+=0.01;
}
sat1();
}
void doInit()
{
/* Background and foreground color */
glClearColor(0.0,0.0,0.0,0);
glViewport(0,0,640,480);
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-13.0f);
stroke_output(-2.0, 1.7, "s/S--> Start");
stroke_output(-2.0, 0.9, "t--> Transmit");
stroke_output(-2.0, 0.0, "q/Q-->Quit");
GLfloat mat_ambient[]={0.0f,1.0f,2.0f,1.0f};
GLfloat mat_diffuse[]={0.0f,1.5f,.5f,1.0f};
GLfloat mat_specular[]={5.0f,1.0f,1.0f,1.0f};
GLfloat mat_shininess[]={50.0f};
glMaterialfv(GL_FRONT,GL_AMBIENT,mat_ambient);
glMaterialfv(GL_FRONT,GL_DIFFUSE,mat_diffuse);
glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);
GLfloat lightIntensity[]={1.7f,1.7f,1.7f,1.0f};
GLfloat light_position3[]={0.0f,8.0f,10.0f,0.0f};
glLightfv(GL_LIGHT0,GL_POSITION,light_position3);
glLightfv(GL_LIGHT0,GL_DIFFUSE,lightIntensity);
GLfloat lightIntensity1[]={1.7f,1.7f,1.7f,1.0f};
GLfloat light_position31[]={-2.0f,8.0f,10.0f,0.0f};
glLightfv(GL_LIGHT1,GL_POSITION,light_position31);
glLightfv(GL_LIGHT1,GL_DIFFUSE,lightIntensity1);
glEnable(GL_COLOR_MATERIAL);
glFlush();
glutSwapBuffers();
}
void info_page(){
glClearColor(0.2, 0.2, 0.2, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
glutSwapBuffers();
}
RESULT
5.1 Snapshot-1:
Figure 5.1 shows the title of the project and team members name. When the Enter Key
is pressed the complete animation is played from beginning to the end.
26
Working of a Satellite Chapter 5
5.2 Snapshot-2:
Figure 5.2 is a menu page where all the key instructions regarding the working of the
project is displayed.
5.3 Snapshot-3:
Figure 5.3 shows the revolution of the satellite around the earth.
5.4 Snapshot-4:
Figure 5.4 shows the transmission of data signals from the network to the satellite.
5.5 Snapshot-5:
Figure 5.5 shows retransmission of data signals from the satellite to the three different
buildings.
CONCLUSION
The project ”Working of a Satellite” , implemented using OpenGL, has been successfully
completed and offers a comprehensive demonstration of satellite operations. Through its
realistic 3D graphics and interactive interface, the project effectively showcases the trans-
mission and reception of signals to and from a satellite. It provides valuable educational
insights into satellite communication, including signal propagation, modulation, and de-
modulation.
Overall, this project stands as a testament to the power of OpenGL in creating visually
immersive and informative simulations of satellite technology.
29
References
[1] https://www.plagzero.com/
[2] https://www.youtube.com/
[3] https://stackoverflow.com/
30