Chapter - 1: Aeroplane Crash
Chapter - 1: Aeroplane Crash
CHAPTER - 1
INTRODUCTION
Although early application in engineering & science had to relay on expensive &
cumbersome equipments, advances in computer technology have made interactive computer
graphics a practical tool. Today it found Computer Graphics in a diverse area such as science,
engineering, medicine, business, industry, government, art, entertainment, education and
training. Now you are able to answer about computer graphics as generalized tool for
drawing and creating pictures and simulate the real world situations within a small computer
window.
History
William fetter was credited with coining the term Computer Graphics in 1960, to describe his
work at Boeng. One of the first displays of computer animation was future world (1976),
which included an animation of a human face and hand-produced by Carmull and Fred Parkle
at the University of Utah.
There are several international conferences and journals where the most significant results in
computer-graphics are published. Among them are the SIGGRAPH and Euro graphics
conferences and the association for computing machinery (ACM) transaction on Graphics
journals.
Computer Aided Design methods are routinely used in the design of buildings, automobiles,
aircraft, watercraft, spacecraft computers, textiles and many other applications.
2) CG in presentation Graphics:
Another major application area presentation graphics used to produce illustrations for reports
or generate slides. Presentation graphics is commonly used to summarize financial, statistical,
mathematical, scientific data for research reports and other types of reports.2D and 3D bar
chart to illustrate some mathematical or statistical report.
4)Entertainment:
Computer graphics methods are now commonly used in making motion pictures, music,
videos, games and sounds. Sometimes graphics objects are combined with the actors and live
scenes.
6) Image Processing:
Although the methods used in CG image processing overlap, the 2 areas are concerned with
fundamentally different operations. In CG a computer is used to create picture. Image
processing on the other hand applies techniques to modify existing pictures such as photo
scans, TV scans.
7)User Interface:
Most of our application will be designed to access OpenGL directly through functions in
three libraries. Functions in the main GL (or OpenGL in windows) library have names that
begin with the letters gl and are stored in a library usually referred to as GL (or OpenGL in
windows). The second is the OpenGL Utility Library (GLU). This library uses only GL
functions but contains code for creating common objects and simplifying viewing. All
functions in GLU can be created from the core GL library but application programmers prefer
not to write the code repeatedly. The GLU library is available in all OpenGL
implementations; functions in the GLU library begin with letters glu
.
To interface with the window system and to get input from external devices into our
programs, we need at least one more library. For each major window system there is a
system-specific library that provides the “glu” between the window system and OpenGL. For
the X window system, this library is called GLX, for windows, it is wgl, and for the
Macintosh, it is a gl. Rather than using a different library for each system, we use a readily
available library called the OpenGL Utility Toolkit (GLUT), which provides the minimum
functionality that should be expected in any modern windowing system.
Fig.1 shows the organization of the libraries for an X Window System environment. For this
window system, GLUT will use GLX and the X libraries. The application program, however,
can use only GLUT functions and thus can be recompiled with the GLUT library for other
window systems.
GLU
GL
OpenGL application Frame
Program Xlib, Xtk Buffer
GLUT
GLX
Some OpenGL commands accept as many as 8 different data types for their
arguments. The letters used as suffixes to specify these data types for ISO C implementations
of OpenGL are shown in Table.1, along with the corresponding OpenGL type definitions
updates are announced in time for developers to adopt changes. Backward compatibility
requirements ensure that existing applications do not become obsolete.
Reliable and portable: All OpenGL applications produce consistent visual display
results on any OpenGL API-compliant hardware, regardless of operating system or
windowing system.
Evolving: Because of its thorough and forward-looking design, OpenGL allows new
hardware innovations to be accessible through the API via the OpenGL extension
mechanism. In this way, innovations appear in the API in a timely fashion, letting
application developers and hardware vendors incorporate new features into their normal
product release cycles.
CHAPTER 2
Requirement Specification:
A Software requirements definition is an abstract description of the service which the system
should provide, and the constraints and which system must operate.it should only specify the
external behaviour of the system.
CHAPTER 3
DESIGN
User Defined Functions:
1) myinit(): This function initializes light source for ambient, diffuse and specular types.
2) display():This function creates and translates all the objects in a specified location in a
particular order and also rotates the objects in different axes.
glClear(GL_COLOR_BUFFER_BIT);
glFlush()
3) timerfunc():This function starts a timer in the event loop that delays the event loop for
delay miiliseconds.
4) MainLoop(): This function whose execution will cause the program to begin an event
processing loop.
5) PushMatrix(): Save the present values of attributes and matrices placing ,or pushing on
the top of the stack.
8) main(): The execution of the program starts from this function. It initializes the graphics
system and includes many callback functions.
9) PostRedisplay(): It ensures that the display will be drawn only once each time the
program goes through the event loop.
CHAPTER – 4
IMPLEMENTATION
The whole program has been implemented in C language. The bottom line of the design is
Rotation, mouse interaction, keyboard interaction and some minor functions to print the text
on the screen. With the help of keyboard interaction and mouse interaction a player can
switch to different pages and can play the game etc.
In this project we have created a airplane crashing using opengl functional API we have taken
the help of built in functions present in the header file to provide functionally to our project
we have written sub functions. These functions provide us the efficient way to design the
project. In this project chapter we are describing the functionality of our project using these
functions.
glVertex2f(100.0,40.0);
glVertex2f(80.0,15.0);
glVertex2f(50.0,15.0);
glEnd();
glPopMatrix();
if(c>360) //timer to jump to next display
{
display2();
d+=20;//plane takeoff on x in 2nd display
}
if(a>500.0)//window position during take off
{
a=0.0;
b=0.0;
}
if(c>750)//timer to jump to 3rd display
{
display3();
e+=20;//plane takeoff on x in 3rd display
if(e>250)//timer to call blast function
{
blast();
e=250;
}
}
glFlush();
}
glVertex2f(350.0,280);
glVertex2f(400.0,200);
glEnd();
glColor3f(0.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2f(350.0,380);
glVertex2f(400.0,300);
glEnd();
glColor3f(0.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2f(450.0,100);
glVertex2f(400.0,100);
glEnd();
glColor3f(0.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2f(450.0,200);
glVertex2f(400.0,200);
glEnd();
glColor3f(0.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2f(450.0,300);
glVertex2f(400.0,300);
glColor3f(0.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2f(350.0,180);
glEnd();
build_outline();
}
glVertex2f(450.0,400.0);
glVertex2f(450.0,0.0);
glEnd();
glColor3f(0.0,0.0,0.0);
glBegin(GL_LINE_LOOP);
glVertex2f(400.0,400.0);
glVertex2f(350.0,480.0);
glVertex2f(400.0,480.0);
glVertex2f(450.0,400.0);
glEnd();
}
glPopMatrix();
}
glBegin(GL_POLYGON);
glVertex2f(400.0,40.0);
glVertex2f(408.0,60.0);
glVertex2f(458.0,60.0);
glVertex2f(450.0,40.0);
glEnd();
glPopMatrix();
}
CHAPTER – 5
SNAPSHOTS
Fig 1: Plane ready to take-off
CHAPTER 6
CONCLUSION
This project is one of the sample project on Computer Graphics. Though many difficulties
were faced during the project as well as many errors occurred, we became succeed to com-
pile and run the program. There may be some limitations on this project as well, so, in the
near future we would like to be hopeful in further improvements. We are highly obliged to all
helping hands and to all inspirations to make this project successful. Well this project will be
applicable to most of all. As well as, we are more hopeful for more advice, new ideas and
inspiration to make more other projects. To had tried our best to include each and every basic
features of graphics in our projects.
We aimed it to be an interfacing application to the real world that means our project must not
be an project for any examination but also applicable for real world use. We have able to give
some benefits to the disability. It somehow makes our life easier in this or that way. From
this very project we were able to achieve various knowledge in computer graphics and also
in logical coding. We refresh our knowledge in C Programming. Moreover we also gained an
experience of group work, team coordination. We learned how team work is very much
important in engineering field.
CHAPTER 7
REFERENCES
[1] Donald, Hearn. Computer Graphics. Pearson Education: 2005, Pearson Education.
[2] www.learnstreet.com
[3] http://www.sourcecodesworld.com/