0% found this document useful (0 votes)
21 views37 pages

CG Mini Project Report

The document discusses a project report on the working of a satellite. It was submitted by two students, Rohit Arun Nayak and Shreyith J Amin, in partial fulfillment of their bachelor's degree in computer science engineering. The project aimed to illustrate the working concepts of a satellite using OpenGL. It created 3D graphics to represent a satellite revolving around the earth and transmitting signals to and from various objects to demonstrate its functions.

Uploaded by

Shreyith J Amin
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)
21 views37 pages

CG Mini Project Report

The document discusses a project report on the working of a satellite. It was submitted by two students, Rohit Arun Nayak and Shreyith J Amin, in partial fulfillment of their bachelor's degree in computer science engineering. The project aimed to illustrate the working concepts of a satellite using OpenGL. It created 3D graphics to represent a satellite revolving around the earth and transmitting signals to and from various objects to demonstrate its functions.

Uploaded by

Shreyith J Amin
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/ 37

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“JNANA SANGAMA”, BELAGAVI - 590 018

A PROJECT REPORT
on
“ WORKING OF A SATELLITE ”
Submitted by

ROHIT ARUN NAYAK 4SF20CS106


SHREYITH J AMIN 4SF20CS139
In partial fulfillment of the requirements for VI Sem B.E.(CSE)
in

COMPUTER GRAPHICS LABORARTORY WITH MINI


PROJECT (18CSL67)

Under the Guidance of


Mrs. Bhavana A S
Department of CSE
at

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)

Department of Computer Science & Engineering

CERTIFICATE

This is to certify that the project entitled “WORKING OF A SATELLITE” is submit-


ted in partial fulfillment for the requirement of VI Sem B.E. (Computer Science & Engineer-
ing), ”COMPUTER GRAPHICS LABORARTORY WITH MINI PROJECT (18CSL67)”
during the year 2022 - 23 is a result of bonafide work carried out by.

ROHIT ARUN NAYAK 4SF20CS106

SHREYITH J AMIN 4SF20CS139

———————————– ———————————–
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.

It gives us immense pleasure in presenting this project report on ”WORKING OF A


SATELLITE”. It has been our privilege to have a project guide who had assisted us
from the commencement of this project. The success of this project is a sheer diligent
work, and determination put in by us with the help of our project guide.

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 are additionally grateful to Dr Nagesh H R, Head of the Department, Computer


Science and Engineering for furnishing us with the correct academic atmosphere in the
department.

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.

Rohit Arun Nayak (4SF20CS106)


Shreyith J Amin (4SF20CS139)

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

1.1 OpenGL Library Organization . . . . . . . . . . . . . . . . . . . . . . . . . 2

3.1 Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

5.1 Introduction Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26


5.2 Interaction Key Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3 Satellite revolving around the Earth . . . . . . . . . . . . . . . . . . . . . . 27
5.4 Trasmission of Signals from Tower to Satellite . . . . . . . . . . . . . . . . 28
5.5 Transmission of Signals from Satellite to Receiver . . . . . . . . . . . . . . 28

v
Chapter 1

Introduction

1.1 Introduction to Computer Graphics


The term Computer Graphics has been used in a broad sense to describe ”almost everything
on computers that is not text or sound”. Typically, the term computer graphics refers to
several different things:

• The representation and manipulation of image data by a computer.

• The various technologies used to create and manipulate images.

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

1.2 Introduction to OpenGL


OpenGL is a low-level graphics library specification. It makes available to the program-
mer a small set of geometric primitives - points, lines, polygons, images, and bitmaps.[1]
OpenGL provides a set of commands that allow the specification of geometric objects in two
or three dimensions, using the provided primitives, together with commands that control
how these objects are rendered (drawn). Since OpenGL drawing commands are limited to
those that generate simple geometric primitives (points, lines, and polygons), the OpenGL
Utility Toolkit (GLUT) has been created to aid in the development of more complicated
three- dimensional objects such as a sphere, a torus, and even a teapot. GLUT may not
be satisfactory for full-featured OpenGL applications, but it is a useful starting point for
learning OpenGL.. GLUT simplifies the implementation of programs using OpenGL. ren-
dering. The GLUT application programming interface (API) requires very few routines to
display a graphics scene rendered using OpenGL. The GLUT routines also take relatively
few. parameters. [2] OpenGL fosters innovation and speeds application development by
incorporating a broad set of rendering, texture mapping, special effects, and other powerful
Visualization functions. Developers can leverage the power of OpenGL across all popular
desktop and workstation platforms, ensuring wide application deployment.

Figure 1.1: OpenGL Library Organization

Department of Computer Science and Engineering, SCEM, Mangaluru Page 2


Working of a Satellite Chapter 1

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.3 Overview of project


The ”Working of a Satellite” simulation project in OpenGL consists of two scenes. In the
first scene, the focus is on the satellite’s orbit around the Earth. The satellite is depicted
as revolving around the Earth, showcasing its movement in space.
In the second scene, the simulation shifts to the Earth’s surface, where a network tower
is located. The network tower represents a source of data signals that are transmitted to
the satellite. These data signals are visualized as solid cubes, symbolizing the information
being sent.
One important aspect of the simulation is the accurate representation of the Earth’s
geography and landmarks, providing a realistic context for the satellite’s operations.
The satellite, positioned in space, receives the data signals from the network tower. It
acts as a relay or intermediary, capturing the signals and preparing them for transmission
to the required destinations. In this simulation, three different buildings represent these
destinations.
The satellite then sends the received data signals to each of the three buildings, com-
pleting the data transfer process. This highlights the satellite’s role in facilitating commu-
nication and data transmission between different locations on Earth.
Overall, the simulation provides an overview of the working of a satellite by showcasing
its orbit around the Earth, the reception of data signals from a network tower, and the
subsequent transmission of those signals to specific destinations. It helps visualize and
understand the fundamental concepts of satellite communication and data transfer.

Department of Computer Science and Engineering, SCEM, Mangaluru Page 3


Working of a Satellite Chapter 1

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.

• Visualization of Satellite Communication: With its realistic depiction of satel-


lite operations, the project enables effective visualization of how data signals are
transmitted and received by satellites. It facilitates comprehension of concepts such
as signal relay, data transfer, and the interaction between satellites and ground-based
infrastructure.

• Research and Development: The simulation project offers a foundation for


researchers and developers to explore and innovate in the field of satellite communi-
cation. It provides a platform for testing and refining new algorithms, protocols, or
technologies related to satellite communication systems, supporting advancements in
this area of study.

Department of Computer Science and Engineering, SCEM, Mangaluru Page 4


Chapter 2

REQUIREMNET SPECIFICATION

2.1 Project Requirements


Functional Requirements:

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

2.2 Hardware Requirements


The minimum/recommended hardware configuration required for developing the proposed
software is given below:

• INTEL dual core and above compatible systems

• Monitor,Keyboard, Mouse

• AM-512MB(minimum)

2.3 Software Requirements


• Windows 10, 64 bits/Ubuntu

• OpenGL

• DevC++ Software

Department of Computer Science and Engineering, SCEM, Mangaluru Page 6


Chapter 3

System Design

3.1 Flow Chart

Figure 3.1: Flowchart

7
Working of a Satellite Chapter 3

The above flowchart explains the following

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

3.2 Interaction with program


This program includes interaction through the keyboard.

• S/s - Starts/Resumes the animation.

• t - Starts the transmission of signals

• Q/q - Quits from the animation

Department of Computer Science and Engineering, SCEM, Mangaluru Page 8


Chapter 4

IMPLEMENTATION

4.1 Implementation of OpenGL Built-In Functions


• glutInit() : interaction between the windowing system and OpenGL is initiated.

• glutInitDisplayMode(): Used to specify the display mode, including double buffer-


ing and depth information requirements.

• glutCreateWindow(): Opens an OpenGL window and displays the specified title


at the top of the window.

• glutInitWindowSize(): Sets the size of the window.

• glutInitWindowPosition(): Sets the position of the window in screen coordinates.

• glutKeyboardFunc(): Handles normal ASCII symbols from the keyboard.

• glutSpecialFunc(): Handles special keyboard keys

• glutReshapeFunc(): Sets up the callback function for reshaping the window.

• glutIdleFunc(): Handles background processing.

• glutDisplayFunc(): Handles the redrawing of the window.

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

• glVertex3fv(): Specifies points or vertices in three dimensions.

9
Working of a Satellite Chapter 4

• glColor3fv(): Sets the color of rendered faces.

• glFlush(): Flushes the rendering pipeline.

• glutPostRedisplay(): Requests an automatic redraw of the object.

• glMatrixMode(): Sets the current matrix mode, such as modelview or projection.

• glLoadIdentity(): Loads the identity matrix, initializing the transformation ma-


trix.

• glTranslatef(): Translates or moves the rotation center from one point to another
in three dimensions.

• glRotatef(): Rotates an object through a specified rotation angle.

• gluOrtho2D(): Defines a 2D orthographic projection matrix.

• glLineWidth(): Sets the width of rendered lines.

• glClear(): Clears the buffers to prepare for rendering a new frame.

• glDepthFunc(): Sets the depth comparison function for depth testing.

4.2 Implementation of User-Defined Functions


#include <windows.h>
#include<string.h>
#include<stdarg.h>
#include<stdio.h>
#include <GL/glut.h>
#include <math.h>

static double x=0.0;


static double move=-60;
static float rx[100]={0}, ry[100]={0};

//control waves
static double w1=0,w2=0,w3=0;
static bool transmit=false;

Department of Computer Science and Engineering, SCEM, Mangaluru Page 10


Working of a Satellite Chapter 4

void *font;
void *currentfont;

void setFont(void *font)


{
currentfont=font;
}

void drawstring(float x,float y,float z,char *string)


{
char *c;
glRasterPos3f(x,y,z);
for(c=string;*c!=’\0’;c++)
{
glColor3f(0.0,1.0,1.0);
glutBitmapCharacter(currentfont,*c);
}
}
void stroke_output(GLfloat x, GLfloat y, char *format,...)
{
va_list args;
char buffer[200], *p;
va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);
glPushMatrix();
glTranslatef(-2.5, y, 0);
glScaled(0.003, 0.005, 0.005);
for (p = buffer; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glPopMatrix();
}

Department of Computer Science and Engineering, SCEM, Mangaluru Page 11


Working of a Satellite Chapter 4

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();

Department of Computer Science and Engineering, SCEM, Mangaluru Page 12


Working of a Satellite Chapter 4

// 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();
}

void building(float x1,float y1,float z1){


//Main Structure
glPushMatrix();
glColor3f(0.5,0.5,0.5);
glTranslatef(x1,y1,z1);
glScaled(0.5,1.5,0.5);
glutSolidCube(2);
glPopMatrix();

//Dish on top

Department of Computer Science and Engineering, SCEM, Mangaluru Page 13


Working of a Satellite Chapter 4

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();

Department of Computer Science and Engineering, SCEM, Mangaluru Page 14


Working of a Satellite Chapter 4

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);

Department of Computer Science and Engineering, SCEM, Mangaluru Page 15


Working of a Satellite Chapter 4

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);

Department of Computer Science and Engineering, SCEM, Mangaluru Page 16


Working of a Satellite Chapter 4

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();

//Ack to right building


glPushMatrix();
if(transmit){
glRotatef(50,0,0,1);
glTranslatef(2.8,3.2-w2,0);
}else glTranslatef(1,20,3.3);
waves();
glPopMatrix();

Department of Computer Science and Engineering, SCEM, Mangaluru Page 17


Working of a Satellite Chapter 4

//Ack to Left building


glPushMatrix();
if(transmit){
glRotatef(-50,0,0,1);
glTranslatef(-2.8,3.2-w2,0);
}else glTranslatef(1,20,3.3);
waves();
glPopMatrix();

//Ack to Center building


glPushMatrix();
if(transmit){
glRotatef(23,0,0,1);
glTranslatef(1,3.2-w3,3.3);
}
else glTranslatef(1,20,3.3);
waves();
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();

Department of Computer Science and Engineering, SCEM, Mangaluru Page 18


Working of a Satellite Chapter 4

//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);

Department of Computer Science and Engineering, SCEM, Mangaluru Page 19


Working of a Satellite Chapter 4

//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;
}

Department of Computer Science and Engineering, SCEM, Mangaluru Page 20


Working of a Satellite Chapter 4

sat1();
}

void doInit()
{
/* Background and foreground color */
glClearColor(0.0,0.0,0.0,0);
glViewport(0,0,640,480);

/* Select the projection matrix and reset it then


setup our view perspective */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(30.0f,(GLfloat)640/(GLfloat)480,0.1f,200.0f);

/* Select the modelview matrix, which we alter with rotatef() */


glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClearDepth(2.0f);
glEnable(GL_DEPTH_TEST);
glEnable( GL_COLOR_MATERIAL );
glDepthFunc(GL_LEQUAL);
}

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};

Department of Computer Science and Engineering, SCEM, Mangaluru Page 21


Working of a Satellite Chapter 4

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 menu(int id)


{
switch(id)
{
case 1:glutIdleFunc(S);
break;
case 2:glutIdleFunc(s);
break;
case 5:exit(0);
break;
}
glFlush();
glutSwapBuffers();
glutPostRedisplay();
}

Department of Computer Science and Engineering, SCEM, Mangaluru Page 22


Working of a Satellite Chapter 4

void mykey(unsigned char key,int x,int y)


{
if(key==’s’)
{
glutIdleFunc(s);
}
if(key==’S’)
{
glutIdleFunc(S);
}
if(key==’e’)
{
glutIdleFunc(e);
}
if(key==’t’)
{
transmit=!transmit;
if(!transmit)
{
w1=0;
w2=0;
w3=0;
}
glutIdleFunc(S);
}
if(key==’q’||key==’Q’)
{
exit(0);
}
}

void displayRasterText(float x, float y, float z, const char* text) {


glRasterPos3f(x, y, z);

Department of Computer Science and Engineering, SCEM, Mangaluru Page 23


Working of a Satellite Chapter 4

for (const char* c = text; *c != ’\0’; c++) {


glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *c);
}
}

void info_page(){
glClearColor(0.2, 0.2, 0.2, 1.0);
glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1.0, 0.6, 0.2);


displayRasterText(-550, 700, 0.0, "SAHYADRI COLLEGE OF ENGINEERING AND MANAGEMENT,

glColor3f(1.0, 1.0, 1.0);


displayRasterText(-475, 610, 0.0, "DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING"

glColor3f(1.0, 1.0, 1.0);


displayRasterText(-225, 500, 0.0, "A MINI PROJECT TITLED ");

glColor3f(1.0, 0.0, 0.0);


displayRasterText(-225, 370, 0.0, "WORKING OF SATELLITE");

glColor3f(1.0, 0.8, 0.2);


displayRasterText(-120, 250, 0.0, "created by");

glColor3f(1.0, 1.0, 1.0);


displayRasterText(-800, 0, 0.0, "ROHIT ARUN NAYAK");
displayRasterText(-750, -85, 0.0, "(4SF20CS106)");
displayRasterText(500, 0, 0.0, "SHREYITH J AMIN");
displayRasterText(550, -85, 0.0, "(4SF20CS139)");

glColor3f(1.0, 0.6, 0.2);


displayRasterText(-200, -300, 0.0, "Under the Guidance of");
glColor3f(1.0, 1.0, 1.0);
displayRasterText(-160, -380, 0.0, "Ms. BHAVANA A S");

Department of Computer Science and Engineering, SCEM, Mangaluru Page 24


Working of a Satellite Chapter 4

glColor3f(1.0, 0.6, 0.2);


displayRasterText(-230, -500, 0.0, "Academic Year 2022-2023");
glColor3f(1.0, 1.0, 1.0);
displayRasterText(-260, -650, 0.0, "Press ENTER to start the simulation");

glFlush();
glutSwapBuffers();
}

int main(int argc, char *argv[])


{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowSize(1000,480);
glutInitWindowPosition(0,0);
glutCreateWindow("Working of a Satellite");
glutDisplayFunc(display);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHT1);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
glutKeyboardFunc(mykey);
glutCreateMenu(menu);
glutAddMenuEntry("Pyramid ’s’",1);
glutAddMenuEntry("Reverse Pyramid ’S’",2);
glutAddMenuEntry("Quit ’q’",5);
glutAttachMenu(GLUT_RIGHT_BUTTON);
doInit();
glutMainLoop();
return 0;
}

Department of Computer Science and Engineering, SCEM, Mangaluru Page 25


Chapter 5

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.

Figure 5.1: Introduction Page

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.

Figure 5.2: Interaction Key Menu

5.3 Snapshot-3:
Figure 5.3 shows the revolution of the satellite around the earth.

Figure 5.3: Satellite revolving around the Earth

Department of Computer Science and Engineering, SCEM, Mangaluru Page 27


Working of a Satellite Chapter 5

5.4 Snapshot-4:
Figure 5.4 shows the transmission of data signals from the network to the satellite.

Figure 5.4: Trasmission of Signals from Tower to Satellite

5.5 Snapshot-5:
Figure 5.5 shows retransmission of data signals from the satellite to the three different
buildings.

Figure 5.5: Transmission of Signals from Satellite to Receiver

Department of Computer Science and Engineering, SCEM, Mangaluru Page 28


Chapter 6

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

You might also like