Computer Graphics Report
Computer Graphics Report
“STEAM ENGINE”
Submitted in partial fulfilment of the requirement for the award of degree of
Bachelor of Engineering
In
Computer Science and Engineering
Submitted by
YASHASWINI K.S
(4NN17CS047)
VINUTHA R
(4NN18CS411)
Under the Guidance of
Mr. Ajay A V.
Assistant Professor
Dept. of CS & Engineering
CERTIFICATE
This is to certify that the mini project entitled “STEAM ENGINE” is carried out by
YASHASWINI K.S and VINUTHA R bearingUSN:4NN17CS047,4NN18CS411 respectively
in the partial fulfilment for the Fifth semester of Bachelor of Engineering degree in
Computer Science and Engineering of the Visvesvaraya Technological University,
Belagavi during the academic year 2019-20. The project report has been approved as it
satisfies the academic requirements with respect to project work prescribed for the Bachelor
of Engineering.
External Viva
1…………………….... 1……………………….
2………………………. 2 ………………………
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any task
would be incomplete without the mention of the people who made it possible, whose
consistent guidance and encouragement crowned our efforts with success.
We wish to express our gratitude to Prof. Bansilal, Principal, NIE Institute of Technology
Mysuru, for providing a congenial working environment.
We express our sincere thanks to Smt. Vedavathi N, Assistant Professor and Head,
Department of Computer Science and Engineering, for her support and encouragement.
We would like to thank our guide, Mr. Ajay A V. Assistant Professor, Department of
Computer Science and Engineering, for his inspiration, guidance, constant supervision,
direction and discussions in the successful completion of this project work.
We are thankful to the Department of Computer Science and Engineering staff members and
non-staff members for their co-operation extended towards this work.
Finally, our heartfelt gratitude to our family members, relatives and friends for their
constant support, motivation and encouragement throughout this project. Above all we would
like to thank God Almighty, for having showered his blessings on us.
YASHASWINI
K.S (4NN17CS047)
VINUTHA R (4NN18CS411)
ABSTRACT
AIM: The aim of the project is to create a STEAM ENGINE.A steam engine uses
heat and steam to create mechanical power.
A steam engine is a heat engine that performs mechanical work using steam as its working
fluid.There have been many different types of steam engines throughout history;some use
wood and others use coal to generate the necessary steam.Most steam engines work by
heating water in a chamber,which creates or holds steam.The pressure of the steam can then
be directed through pipes and valves to generate mechanical power.Steam engines have been
applied to a wide range of uses.The first steam engines were simple pumps used to remove
water from mineshafts.After some improvements,more efficient and powerful steam engines
were being used to power trains,ships,and entire factories.
LIST OF CONTENTS
CHAPTER 1
INTRODUCTION
First Come First Serve Algorithm is OS based
Computer graphics Project. This Project as name
suggest demonstrate the working of First Come First
Serve Algorithm or FCFS Algorithm. The objects are
drawn using the GLUT functions. This project has been
developed using Code::Blocks IDE on Windows 10
operating system with OpenGL package.
1. Main GL: Library has names that begin with the letter gl and are stored in
a library usually referred to as GL.
2. OpenGL Utility Library (GLU): This library uses only GL functions but
contains code for creating common objects and simplifying viewing.
3. OpenGL Utility Toolkit (GLUT): This provides the minimum functionality that
should be accepted in any modern windowing system.
● OpenGL (Open Graphics Library) is the interface between a graphic program and
graphics hardware. It is streamlined. In other words, it provides low-level
functionality. For example, all objects are built from points, lines and convex
polygons. Higher level objects like cubes are implemented as six four-sided
polygons.
● OpenGL supports features like 3-dimensions, lighting, anti-aliasing, shadows,
textures, depth effects, etc.
● It is system-independent. It does not assume anything about hardware or operating
system and is only concerned with efficiently rendering mathematically described
scenes. As a result, it does not provide any windowing capabilities.
● It is a state machine. At any moment during the execution of a program there is a
current model transformation.
● It is a rendering pipeline. The rendering pipeline consists of the following steps:
○ Defines objects mathematically.
○ Arranges objects in space relative to a viewpoint.
○ Calculates the color of the objects.
○ Rasterizes the objects.
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.
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. 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.
● Processor : PentiumPC
● RAM : 512MB
● Hard Disk : 20 GB(approx)
● Display : VGA ColorMonitor
● Keyboard: QWERTY Keyboard
● Mouse : 2 or 3 Buttonmouse
OpenGL APIs:
If we want to have a control on the flow of program and if we want to interact
with the window system then we use OpenGL API’S. Vertices are represented in the
same manner internally, whether they are specified as two-dimensional or three-
dimensional entities, everything that we do are here will be equally valid in three
dimensions. Although OpenGL is easy to learn, compared with other APIs, it is
nevertheless powerful. It supports the simple three-dimensional programs and also
supports the advanced rendering techniques.
GL/glut.h:
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. The application program uses only GLUT functions and can be
recompiled with the GLUT library for other window system. OpenGL makes a heavy
use of macros to increase code readability and avoid the use of magic numbers. In
most implementation, one of the include lines.
CHAPTER 3
ABOUT THE PROJECT
The aim of this project is to create a STEAM ENGINE.The Engine is made up
of a Piston,Engine Pole,Cylinder Head,Flywheel,Crank Bell and a Crank.The viewer is allowed
to rotate the Engine’s Crank either in clock wise or in anti-clock wise direction.The viewer can
also slow up or slow down the Crank speed.
3.1 Overview
First a Piston,Engine Pole, Cylinder Head, Flywheel, Crank Bell and a Crank is
created using myCylinder( ) function. The main primitives used inside the myCylinder( )
function to create a Cylinder is gluCylinder( ) and gluDisk( ) . So every time, myCylinder( )
function is called inside the functions used to create Piston, Engine Pole, Cylinder Head,
Flywheel, Crank Bell and Crank. The parts mentioned above are combined to form a Steam
Engine image. We can make Steam Engine transparent and display. In display function, at first
it clears the drawing buffer and if transparency is set, displays the model twice, first time
accepting those fragments with a ALPHA value of 1 only, then with DEPTH_BUFFER writing
disabled for those with other values. Initially when the animation is not called, the crank angle
will not change and the window is idle. When called increments the crank angle by
ANGLE_STEP, updates the head angle and notifies the system that the screen needs to be
updated. When a menu option has been selected, it translates the menu item identifier into a
keystroke, then calls the keyboard function. A menu will be associated with the mouse too. The
viewer can also see the shaded and textured steam engine
CHAPTER 4
CHAPTER 5
IMPLEMENTATION
5.1:Keyboard function.
5.2:Display function.
5.3:Reshape function.
5.1:Keyboard function:
KEYBOARD
FUNCTION
DISPLAY
FUNCTI0N
glPushMatrix(); if (transparent) {
glEnable(GL_ALPHA_TEST); pass = 2;
} draw_engine_pole(); glPushMatrix(); glTranslatef(0.5, 1.4,
glutSwapBuffers(); glPopMatrix();
do {
glDepthMask(GL_TRUE); pass--;
glDepthMask(GL_FALSE);
pass--;
5.3:Reshape function:
RESHAPE
FUNCTION
glMatrixMode(GL_MODELVIEW);
7.1: Initial
View
7.4: Shading
7.5: Texture
7.6: No Light(Transparency)
Simple Village and City 2019-20
This project allows the user to rotate the piston in a Steam Engine. Its like a Miniature Steam Engine
Simulation.
Future scope:
1. SIMULATOR
Not only the movement of piston, we can make the whole parts in the steam engine
working so that it will be a simulator of steam engine. By modifying this project we can construct a
fully fledged simulator. Students who are studying about the steam engine can work through this and
it will be very helpful for them. Almost a complete picturization of a steam engine can be done
through this.
Books:
1. Edward Angel’s Interactive Computer Graphics Pearson Education,A Top-Down
Woo(THE REDBOOK).
9. Wikipedia.org