Project Report Sample
Project Report Sample
UNIVERSITY
BELGAUM-590 014
2020-2021
of Engineering
CERTIFICATE
Certified that the project work entitled “Helicopter”, carried out by Husna khanum
(1AT18CS04) and Arpitha G(1AT18CS022), a bonafide student of Atria Institute of
Technology, in partial fulfilment for the award of Bachelor of Engineering in Computer
Science & Engineering of Visvesvaraya Technological University, Belgaum during
the academic year 2019-2020. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporated in the Report deposited in the departmental
library. The project report has been approved as it satisfies requirement in respect of
project work prescribed for the said degree.
External Viva
1.______________________________ ___________________________
2.______________________________ ___________________________
DECLARATION
Place: Bangalore
HUSNA KHANUM Date:
1AT18CS042
i
ABSTRACT
Nowadays we see a lot of attention is given towards safe guarding our country or in this
matter any country at their respective borders. Many army men risk their precious life on
the borders of the country to help people have a peaceful night’s sleep without any worry.
Captain AMIGO, is an army robot whose main intention is to save the lives of all the
army men on the borders. It plays the role of a CAPTAIN that is leads from front by itself
going into the risk prone areas and detecting if there is any danger to the soldiers. Also
acts like a detective by taking the live footage of the enemies at the other side of the
border and delivers the same to official in charge so that they can see what is happening
and have a clear idea about it. This robot camouflages itself according to the surrounding
area so that it doesn’t become all the way more evident to the enemies about its existence.
With these been its key features it also has many other components like PIR sensor, Gas
sensor, Metal sensor to find out more about the enemies’ place and also checks if our
country’s army men will remain safe if they walk-in by the same path.
ii
ACKNOWLEDGEMENT
We express gratitude to our institution and management for providing us with good
infrastructure, laboratory, facilities and inspiring staff, and whose gratitude was of
immense help in completion of this project successfully.
We express our sincere gratitude to Dr. K.V. NARAYANA SWAMY, Principal, Atria
Institute of Technology, for providing us the required environment and for his valuable
suggestion.
Our sincere thanks to Dr. AISHWARYA P, Head of the Dept. Computer Science and
Engineering, Atria Institute of Technology, for her valuable support and for rendering
us resources for this project work.
Last but not the least, the project would not have been a success without the support of
our parents and friends. Our sincere thanks should be rendered to everyone who
helped us in all possible ways.
iii
TABLE OF CONTENTS
DECLARATION………………….………………………………………...…. i
ABSTRACT…………………………………………………………………....ii
ACKNOWLEGMENT …………...……………………………………………iii
CHAPTER I INTRODUCTION…………………………………….…........................1
1.1 Objective……………………...………………...……….……………………2
1.2 Motivation………………...…………………...……………………………...2
1.3 Problem Statement……………………………………………………………2
1.4 Scope of the Study……...………………………….........………....................2
CHAPTER II LITERATURE REVIEW.........................................…......[6-10]
.
CHAPTER I
INTRODUCTION
In this chapter we discuss about the application of computer graphics, overview of the graphic
system, graphics architectures. In this project we discuss about OpenGL- open graphics library
API- which is used to develop the application program which is the matter in question.
• Display of Information
• Design
• User interfaces
Display of Information
Classical graphics techniques arose as a medium to convey information among people. Although
spoken and written languages serve this purpose, images are easier to communicate with and
hence the computer graphics plays an important role.
Design
Professions such as engineering and architecture are concerned with design which is an iterative
process. The power of the paradigm of humans interacting with the computer displays was
recognized by Ivan Sutherland.
1
Simulation and animation
Graphics system, now are capable of generating sophisticated images in real time. Hence
engineers and researchers use them as simulators. The most important use has been in the training
of pilots. User interfaces
User interaction with computers has become dominated by a visual paradigm that includes
windows, icons, menus and pointing devices. Applications such as office suites, web browsers are
accustomed to this style.
1.1 Objective:
In this project we are going to design a Helicopter game using Code Blocks. This project displays a
helicopter in flight with its fan and rotor stabilizer moving.
The basic idea of the game is to dodge the rectangles and the game ends when the helicopter touches
one of the rectangles.
The score is calculated based on the distance covered by the helicopter before the crash.
1.2 Motivation:
It is a technology demonstration intended to prove that a small, lightweight helicopter can
fly in the thin atmosphere. The helicopter won’t be controlled with joysticks or keyboards.
But in the future, could use remote controls to fly helicopters. Your game can use keys on
a keyboard to make the helicopter fly.
CHAPTER II
LITERATURE REVIEW
People use the term “computer graphics” to mean different things in different context.
Computer graphics are pictures that are generated by a computer. Everywhere you look today,
you can find examples, especially in magazines and on television. Some images look so natural
you can’t distinguish them from photographs of a real scene. Others have an artificial look,
intended to achieve some visual effects.
There are several ways in which the graphics generated by the program can be delivered.
• Frame- by- frame: A single frame can be drawn while the user waits.
• Frame-by-frame under control of the user: A sequence of frames can be drawn, as in a
corporate power point presentation; the user presses to move on to the next slide, but
otherwise has no way of interacting with the slides
• Animation: A sequence of frames proceeds at a particular rate while the user watches with
delight.
• Interactive program: An interactive graphics presentation is watched, where the user controls
the flow from one frame to another using an input device such as a mouse or keyboard, in a
manner that was unpredictable at the time the program was written.
This can delight the eye.
A GRAPHICS SYSTEM
A computer graphics system is a computer system which has five major elements:
1. Input devices
2. Processor
3. Memory
4. Frame buffer
5. Output devices
This model is general enough to include workstations and personal computers, interactive game systems,
and sophisticated image-generating systems. Although all the components, with the exception of the frame
buffer, are present in standard computer, it is the way each element is specialized for computer graphics that
characteristics this diagram as a portrait of graphics system.
3
Fig 1.1: A Graphics System
GRAPHICS ARCHITECTURES
On one side of the API is the application program. On the other side is some combination of hardware and
software that implements the functionality of the API. There are various approaches to developing
architectures to support graphics API as discussed below.
Display
Processors
Display processors had a conventional architecture that relived the general-purpose computer from the task
of refreshing the screen. These display processors included instructions to display primitives on the display
like CRT. The main advantage of display processor was that the instructions to generate the image could be
assembled once in the host and sent to display processor where they were stored in display processor’s own
memory as display list. Then the display processor would execute these programs in
4
Pipeline
Architecture
Pipeline architecture is the process of giving output of one process as the input to other. This architecture
is prominently used in modern days with the advancement of VLSI. In graphics system; we start with a set
of objects. Each object comprises a set of graphical primitives. Each primitive comprises a set of vertices.
We can think of the collection of primitive types and vertices as defining the geometry of the scene. Thus
the graphics pipeline has four major steps for processing the image:
1. Vertex processing
3. Rasterization
4. Fragment processing
Vertex
Processing
Vertex processing is the first step to be performed in the pipeline architecture. Vertex Processing mainly
involves the transformation of objects, transformation of the coordinate system and projection
transforming. It also involves color computation for each vertex.
Clipping and
Primitive Assembly
Clipping and Primitive Assembly is the second step in the pipeline architecture. The output of the vertex
processor is given as the input to this stage. This step is mainly involved in the clipping of the primitive;
Clipping is necessary since the camera film has a limited size and hence cannot image the whole world at
once. This stage computes the clipping volume and considers only those vertices that falls within this
volume for image formation. Those vertices that are outside this volume do not appear in the image and
are said to be clipped.
5
COMPUTER GRAPHICS LIBRARY ORGANISATION
OpenGL stands for Open Source Graphics Library. Graphics Library is a collection of APIs
(Application Programming Interfaces).
Graphics Library functions are divided in three libraries. They are as follows-
Functions in main GL library name function names that begin with the letter ‘gl’.
• GLU library uses only GL functions but contains code for creating objects and simplify viewing.
• To interface with the window system and to get input from external devices GLUT library is used,
which is a combination of three libraries GLX for X
• These libraries are included in the application program using pre-processor directives. E.g.:
#include<GL/glut.h>
• The following figure shows the library organization in OpenGL.
6
CHAPTER III
SYSTEM ANALYSIS
The primary goal of our model helicopter is to provide the user with a top view
of the territory without resorting to more expensive classical aerial
photogrammetry. The system is designed to collect data for mapping and land
monitoring purposes working on areas which represent a difficult task for
already existing ground-based mobile mapping systems.
Proposed System In this paper, minimizing both under provisioning and over
provisioning problems under the demand and price uncertainty in cloud
computing environments is our mo.- tivation to explore a resource provisioning
strategy for cloud.
7
CHAPTER IV
SYSTEM SPECIFICATION
Requirements analysis is critical for project development. Requirements must be
documented, actionable, measurable, testable and defined to a level of detail
sufficient for system design. Requirements can be architectural, structural,
behavioural, functional, and non-functional. A software requirements
specification (SRS) is a comprehensive description of the intended purpose and
the environment for software under development.
• Windows – XP/7/8
• Microsoft Visual Studio C/C++ 7.0 and above versions
• OpenGL Files
• DirectX 8.0 and above versions
Header Files
8
• glut.h
Object File Libraries
• glut32.lib
DLL files
• glut32.dll
Geometric primitives are specified in the problem domain and include points,
line segments, polygons, curves and surfaces. The geometric primitives exist in
two- and three- dimensional space and hence they can be manipulated by
operations such as rotation and translation.
Raster primitives are used to convert geometric primitives into pixels. Raster
primitives, such as array of pixels, lack geometric properties and cannot be
manipulated in the same way as geometric primitives.
The basic OpenGL primitives are specified by sets of vertices. Thus the
programmer can define the objects in the following form:
glBegin(GLenum mode);
glVertex*(. . .);
9
CHAPTER V
DESIGN AND IMPLEMENTATION
Parameters
Red, green, blue Specify new red, green, and blue values for the current color. Description
glColor3 variants specify new red, green, and blue values explicitly, and set the current alpha value to
1.0 implicitly.Current color values are stored in floating-point format, with unspecified mantissa and
exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-
point values such that the largest representable value maps to 1.0 (full intensity), and zero maps to 0.0
(zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point
values such that t h e m o s t positive represent able value maps to 1.0, and the most negative represent
able value maps to -1.0.Floating-point values are mapped directly.
Neither floating-point nor signed integer values are clamped to the range [0,1] before updating the current
color. However, color components are clamped to this range before they are interpolated or written into a
color buffer.
glClearColor glClearColor - specify clear values for the color buffers. C Specification void
glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) Parameters
red, green, blue, alpha Specify the red, green, blue, and alpha values used when the color buffers
are cleared. The default values are all zero. Description glClearColor specifies the red, green, blue, and
are
10
values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the
Description
The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to
position pixel and bitmap write operations. It is maintained with subpixel accuracy The current raster
position consists of three window coordinates (x, y, z), a clip coordinate value (w), an eye coordinate
distance, a valid bit, and associated color data and texture coordinates. The w coordinate is a clip
coordinate, because w is not projected to window coordinates. glRasterPos4 specifies object coordinates
x, y, z, and w explicitly. glRasterPos3 specifies object coordinate x, y, and zexplicitly, while w is
implicitly set to 1. glRasterPos2 uses the argument values for x and y while implicitly setting z and w to 0
and 1. The current raster position also includes some associated color data and texture coordinates. If
lighting is enabled, then GL_CURRENT_RASTER_COLOR (inRGBAmode) or
GL_CURRENT_RASTER_INDEX (in color index mode) is set to the color produced by the lighting
calculation (see glLight, glLightModel, and glShadeModel). If lighting is disabled, current color (in
RGBA mode, state variable GL_CURRENT_COLOR) or color index (in color index mode, state variable
GL_CURRENT_INDEX) is used to update the current raster color.
GL_CURRENT_RASTER_SECONDARY_COLOR (in RGBA mode) is likewise updated.
Main Function:
It contains calls to various functions to perform different operations. Before a programmer can open a
window, he/she must specify its characteristics: Should it be single-buffered or double-buffered? Should
it store colors as RGBA values or as color indices? Where should it appear on your display? To specify
the answers to these questions, call glutInit(), glutInitDisplayMode(), glutInitWindowSize(), and
glutInitWindowPosition() before you call glutCreateWindow() to open the window.
11
void glutInit(int argc, char **argv); glutInit() should be called before any other GLUT routine, because
it initializes the GLUT library. glutInit() will also process command line options, but the specific options
are window system dependent. For the X Window System, -iconic, -geometry, and -display are examples
of command line options, processed by glutInit(). (The parameters to the glutInit() should be the same as
those to main().) void glutInitDisplayMode(unsigned int mode);
Specifies a display mode (such as RGBA or color-index, or single- or double-buffered) for windows
created when glutCreateWindow() is called. You can also specify that the window have an associated
depth, stencil, and/or accumulation buffer. The mask argument is a bitwise ORed combination of
GLUT_RGBA or GLUT_INDEX, GLUT_SINGLE or GLUT_DOUBLE, and any of the buffer-enabling
flags: GLUT_DEPTH, GLUT_STENCIL, or GLUT_ACCUM. For example, for a double-buffered,
RGBA-mode window with a depth and stencil buffer, use GLUT_DOUBLE | GLUT_RGBA |
GLUT_DEPTH | GLUT_STENCIL. The default value is GLUT_RGBA | GLUT_SINGLE (an RGBA,
single-buffered window). void glutInitWindowSize(int width, int height); void
glutInitWindowPosition(int x, int y);
Requests windows created by glutCreateWindow() to have an initial size and position. The arguments (x,
y) indicate the location of a corner of the window, relative to the entire display. The width and height
indicate the window's size (in pixels). The initial window size and position are hints and may be
overridden by other requests.int glutCreateWindow(char *name);
Opens a window with previously set characteristics (display mode, width, height, and so on). The string
name may appear in the title bar if your window system does that sort of thing. The window is not
initially displayed until glutMainLoop() is entered, so do not render into the window until then. The
value returned is a unique integer identifier for the window. This identifier can be used for controlling
and rendering to multiple windows (each with an OpenGL rendering context) from the same application.
Display Function:
void display()
This function is used to call various functions that draw different objects to be displayed at the location
depending upon where the function call to the particular function is made and messages to be displayed.
It also has functions to set the color and also has function that forces the content of the frame buffer onto
the display (glFlush( )).
Msg Function:
12
string is the variable which collects the string that is to be displayed which is sent as a parameter in the
function call. It uses the GLUT_BITMAP_TIMES_ROMAN_24 font to display the message.
These functions are responsible for drawing rectangles at various positions. The values b and d are
responsible for deciding the exact position of the rectangles.
Limit function:
void limit ()
Helicopter Function:
y co ordinates respectively.
This function is used to draw the helicopter at the specified position. This function contains code to draw
various parts of the helicopter such as black line, head, big wing, small wing, foot, foot line.
Crashed Helicopter Function: void crashed_helicopter(int x, int y) x and y represents the co-ordinates
of the crashed helicopter.
This function is used to draw various parts of the crashed helicopter on the game over screen once the
helicopter has touched the rectangle and the game is over.
13
And finally for interaction- to play the game according to a player input- we have mouse and keyboard
events.
Used to display the Up and down green color bars present on the screen.
Mouse function:
glutMouseFunc sets the mouse callback for the current window. When a user presses and releases mouse
buttons in the window, each press and each release generates a mouse callback.
If the left mouse button is pressed the helicopter moves upwards and if the right mouse button is pressed
the helicopter moves downwards.
Keyboard function:
glutKeyboardFunc sets the keyboard callback for the current window. When a user types into the
window, each key press generating an ASCII character will generate a keyboard callback. The key
callback parameter is the generated ASCII character. The state of modifier keys such as Shift cannot be
determined directly; their only effect will be on the returned ASCII data. The x and y callback
parameters indicate the mouse location in window relative coordinates when the key was pressed.
When a new window is created, no keyboard callback is initially registered, and ASCII key strokes in the
window are ignored. Passing NULL to glutKeyboardFunc disables the generation of keyboard callbacks.
14
In this the input interaction happens through keyboard. Pressing Enter starts the game and pressing the
key 8 causes the helicopter to move upwards and pressing the key 2 causes the helicopter to move
downwards. Once the game is over we can restart the game by pressing the key c or exit the game by
pressing the Esc key.
15
1) Primitive Functions: Primitive functions define the low level objects or atomic entities that a system
can display, the primitives include line segments, polygons, pixels, points, text and various types of
curves and surfaces.
2) Attribute Functions: Attribute Functions allow us to perform operations ranging from choosing the
color to display a line segment, to packing a pattern to fill inside any solid figure.
3) Viewing Functions: Viewing functions allow us to specify various views.
4) Transformation Functions: Transformation functions allow us to carry out transformation of objects
such as rotation, translation and scaling.
5) Input Functions: Input functions allow us to deal with the diverse forms of input that characterize
modern graphics system. It deals with devices such as keyboard, mouse and data tablets.
16
6) Control Functions: Control Functions enable us to communicate with the window system, to
initialize the programs, and to deal with any errors that occur during the execution of the program.
7) Query Functions: Query Functions provides information about the API.
17