Professional Documents
Culture Documents
BELGAUM, KARNATAKA
REFLECTING DINO
Submitted by
MONICA SB(3BR12CS054)
MONIKA C(3BR12CS055)
TAMEEM K(3BR12CS117)
Prof.JAGADISH R MB.E.,M.Tech,
CERTIFICATE
External viva
Name of the Examiners Signature with date
1.
2.
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
BELGAUM, KARNATAKA
REFLECTING DINO
Submitted by
MONICA SB(3BR12CS054)
MONIKA C(3BR12CS055)
TAMEEM K(3BR12CS117)
Prof.JAGADISH R MB.E.,M.Tech,
CERTIFICATE
External viva
Name of the Examiners Signature with date
BELGAUM, KARNATAKA
REFLECTING DINO
Submitted by
MONICA SB(3BR12CS054)
MONIKA C(3BR12CS055)
TAMEEM K(3BR12CS117)
Prof.JAGADISH R MB.E.,M.Tech,
CERTIFICATE
External viva
Name of the Examiners Signature with date
1.
2.
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
BELGAUM, KARNATAKA
REFLECTING DINO
Submitted by
MONICA SB(3BR12CS054)
MONIKA C(3BR12CS055)
TAMEEM K(3BR12CS117)
Prof.JAGADISH R MB.E.,M.Tech,
CERTIFICATE
External viva
Name of the Examiners Signature with date
1.
2.
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any
project would be incomplete without mentioning the people who made it possible,
whose constant guidance and encouragements crowned my efforts with success.
We take this opportunity to express the deepest gratitude and appreciation to all
those held me directly or indirectly towards the successful completion of the project.
It is indeed great pleasure and privilege for me to meet this project report. We wish
to take opportunity to pay my profound gratefulness and express my indebtedness
to my guideJAGADISH.R.M andAZHAR BAIG.M,for his keen interest in preparing
the project report and also to the lecturer. S.BASAVARAJ, instructor for helping in
making out this project.
We are also thankful for all the Staff members of Computer Science and Engineering
dept. for their Co-operation of project report.
ABSTRACT
A mini project developing a dinosaur and appreciate how the basic technique works
enable stencilling with the popup menu and the dinosaur goes away
also notice that opengl lighting works correctly with reflection
CONTENTS
Introduction
Analysis
Design
Snapshots
Conclusion & Future Enhancements
Bibliography
Chapter 1
INTRODUCTION
One of the goals of this Software Lab project is to develop a visualization tool.
Forthis purpose a well-known software is used, OpenGL. In this report instead of
directly showing the implementation results, first some OpenGL basics are
introduced so that the reader can understand the things going on behind de
visualization tool.
The Computer Graphics is one of the most effective and commonly used
methods to communicate the processed information to the user. It displays the
information in the form of graphics objects such as pictures, charts, graphs and
diagram instead of simple text.
Computer graphics today is largely interactive: The user controls the contents
structure, and appearance of objects and their displayed images by using input
devices, such as a keyboard, mouse, or touch-sensitive panel on the screen
Image enhancement.
Pattern detection and recognition
Scene analysis and computer vision.
The image enhancement deals with the improvement in the image quality by
eliminating noise or by increasing image contrast. Pattern detection and recognition
deals with the detection and clarification of standard patterns
And finding deviations from these patterns .The optical character recognition (OCR)
technology is a practical example for pattern detection & recognition. Scene
analysis deals with the recognition and reconstruction of 3D model of scene from
several 2D images.
Graphical feed backs to make the simulated environment even more realistic It
provide a tool for producing pictures not only of concrete, real-world objects but
also of abstract ,synthesis of objects.
User interfaces
Plotting of graphs and charts
Chapter 2
ANALYSIS
The Reflect-Dino program has modes for disabling the stenciling and polygon offset
uses. It is worth running Dinosaur with these features toggled off so you can see
the sort of artifacts that result. Important point in the Dinosaur is that the floor
texturing, reflections, and shadowing all co-exist properly.
OpenGL provides rendering capabilities that enable real-time halo effects around 3D
objects within the scene. The approach is straightforward, and we can combine the
OpenGL rendering techniques such as Real-time shadows and reflections.
OpenGL API
OpenGL is a cross-language cross-platform API for making three Dimensional graphic
applications. It is todays prevailing API for developing 2-D and 3-D graphic applications. It has
more than 250 built-in functions that can be used to draw complex shapes of different kinds. The
main OpenGL API consists of three different libraries, they are
Gl library,
Glu library, and
Glut library.
The Glut library is the most recently added library to the OpenGL API, and gives the
programmers the capability to exclude the use of many Windows API functions. In the early day
of OpenGL emergence many successful computer graphics developers had to use many Windows
functions in order for their applications to be successful. There are many other APIs that can be
currently being used to develop graphic applications, but OpenGL has made the top of the line
ever since its emergence in the early 1990s. OpenGL is a product of Silicon Graphics and its
popularity has grown largely in video game industry in the last decade to the present day. Since,
C++ alone was not going to be able to complete the rings as efficient as we desired, we decided
to incorporate the OpenGL API into our application. Since OpenGL is well known for creating
many different kinds of computer visualizations, adding it to the rings System was a wise choice
from our part. There are many different sub APIs in the OpenGL graphics library. In this
application we are going to use the opengl32, glu, glut and gluax libraries. Most of the built-in
function used are straight out of the glu or glut library. Glu and glut library has a lot of optimized
functions that has already been build for programmers to utilize.
2.1 SYSTEM ANALYSIS
System analysis and design is a very important process in any software
development process. This process involves the collection of requirements from
existing systems or users of the system. This Process is called as Requirement
Analysis. Once all the requirements are collected we can then proceed with the
actual designing of the system. During Design process we are involved in actual
implementation of the system. This may involve design of algorithms, modules and
other subsystems. We shall discuss in detail the Requirement analysis and design
phase of this project.
This section attempts to bring out the requirements and specifications as given out by the
VishweshwaraiahTechnologicalUniversity for the completion of the package.
Minimum requirements expected are cursor movement. Transformations on
objects/selected area should be possible. Clipping and filling of areas should be possible.
Good user interface, which can be GUI or Iconic or Menu based, should be provided. On-
line help for all the options and methods of usage should be given. Should use almost all
the graphical input technologies for efficient programming of input devices. Should be a
device independent package that is able to compile and create an executable.
2.3 FUNCTIONAL REQUIREMENTS
It should give a clear picture of simple animation.
It should show the usage of perspective view and material properties.
It shall be able to meet the users animation requirements.
It shall be able to run even over the low end systems.
It shall be easy to understand.
2.4 EXTERNAL INTERFACE REQUIREMENTS
2.4.1 User Interface
The interface for the project requires for the user to have a mouse connected, and the
corresponding drivers installed. This is because most of the implementation details
require and presume the presence of a mouse.
For the convenience of the user, there are pop-up menus and sub-menus displayed on the
screen.
POP-UP MENU:
A menu that can be set to appear when a specified mouse button is pressed in a window.
A pop-up menu consists of multiple menu items.
SUB-MENU:
A menu cascaded from some sub-men you trigger.
Chapter 3
DESIGN
3.1 DATA DESIGN
The Data Design describes structures that reside within the software. Attributes and
relationships between data objects dictate the choice of data structures. Designing data is about
discovering and completely defining your application's data characteristics and processes. Data
design is a process of gradual refinement, from the coarse "What data does your application
require?" to the precise data structures and processes that provide it. With a good data design,
your application's data access is fast, easily maintained, and can gracefully accept future data
enhancements.
Data Structures Used
The data structures that we are making use in this package are arrays, pointers, stack.
Arrays: The arrays are used to hold continuous homogeneous data in linear order.
Pointer:Pointers are the memory locations that are stored in the memory cells. By using a
pointer, by holding a memory address rather than the data one memory cell can point to another
memory cell.
Stack:Last-In, First-Out" or LIFO, which is used to describe the behavior, since the last item to
enter the stack is the first item to leave the stack. The top item is the item always the last item to
enter the stack and it is always the first item to leave the stack since no other items can be
removed until the top item is removed. Stack is used to push and pop matrices while performing
transformations such as rotation, translation and scaling.
3.1.1 Data Definition
Explains the general process of defining tables, rows, columns, data types, keys, and
relationships. The various data types used in our project are
GLfloat: A GLfloat data type is used to declare float variables. .
Enum: An enumeration type declaration contains the enum keyword followed by an optional
identifier (the enumeration tag) and a brace-enclosed list of enumerators. Commas separate each
enumerator in the enumerator list. The keyword enum, followed by the identifier, names the data
type. The list of enumerators provides the data type with a set of values.
3.2 ARCHITECTURAL DESIGN
argcp: A pointer to the program's unmodifiedargc variable from main. Upon return,
the value pointed to by argcp will be updated, because glutInit extracts any
command line options intended for the GLUT library.
argv: The program's unmodifiedargv variable from main. Like argcp, the data for
argv will be updated because glutInit extracts any command line options
understood by the GLUT library
glutInitDisplayMode
glutCreateWindow
glutMainLoop
glutSwapBuffers
gluLookAt Function
Syntax: void gluLookAt (eyex, eyey, eyez,centerx, centery, centerz,upx, upy, upz);
Eyex, eyey, eyezThe position of the eye point.
glCallList
glEnable
GL_LIGHTIN
G If enabled, use the current lighting parameters to compute the
vertex color or index
GL_NORMAL
IZE If enabled, normal vectors specified with glNormal are scaled to unit
length after transformation
glFrustum
bottom,t Specify the coordinates for the bottom and top horizontal clipping planes.
op
near, far Specify the distances to the near and far depth clipping planes. Both distances must
be positive.
glLightModel
glLightModelfv, glLightModeliv- set the lighting model parameters
Syntax:voidglLightModelfv( GLenumpname, constGLfloat*params )
voidglLightModeliv( GLenumpname, constGLint*params )
glMaterial
[[
glNewList
glPushMatrix
glScale
glScaled, glScalef- multiply the current matrix by a general scaling matrix
Syntax:voidglScaled( GLdoublex, GLdoubley, GLdoublez )
void glScalef( GLfloatx, GLfloaty, GLfloatz )
x,y,z Specify scale factors along the x, y, and z axes, respectively
glViewport Function
width, height The width and height, respectively, of the viewport. When an OpenGL
context is first attached to a window, width and height are set to the dimensions of
that window.
void shadowMatrix(GLfloatshadowMat[4][4],
GLfloatgroundplane[4],GLfloatlightpos[4])
This function creates a matrix that will desire shadows and this function also
having dot product between light position vector and groundplane.
This function shows the properties of dinosaur. For example body, arms,
colors etc.
This function controls the light for dinosaur ii in textures, shadow, and
reflection.
This function indicates that when not visible, stop animating. Restart when
visible again.
The model coordinate pipeline is optimized for vertex arrays and display list
mode. The model coordinate pipeline also recognizes consistent data types within
glBegin/glEnd pairs. One of the major advances in graphics software systems
occurred when graphics systems allowed uses to work in any coordinate system
that they design. The users coordinate system is called world coordinate system.
The Orthogonal coordinate system usually referred to as viewing coordinate
system. We must do clipping because of the limitation that no imaging system can
see the whole world advance. We obtain the equivalent property in the synthetic
camera by considering a clipping volume. The projections of objects in this
volume appear in the image. Those that are outside do not and are said to be
clipped out. For raster devices, such as most CRT displays, unit on the display are
called window coordinates and are always expressed in some integer type. A
viewport is a rectangular area of display window. The viewport is a part of the
state. If we change the viewport between rendering objects orrerendering the same
objects with the viewport changed, we achieve the effect of multiple viewports with
different images in different parts of the window
The Interface Design describes internal and external program interfaces as well as
the design of human interface. Internal and external interface design is based on
the information obtained from the analysis model.The Conceptual framework model
for an interactive graphics system is shown in figure below. It mainly consists of
Application Model, Application Program, and Graphics system and hardware
components. Each of these systems interacts to produce an effective graphics
display. The detailed description of the components is explained in the following
section.
Graphics System
Applicationmodel
Application program
Software Components
Hardware Components
Application Model: The application model captures all the data and objects to be
pictured on the Screen. It also captures the relationship among the data and objects
these relationship are stored in the database called application database, and
referred by the application programs.
should appear. The graphics system is responsible for actually producing the picture
from the detailed descriptions and for passing the users input to the application
program for processing.
Hardware Components: The hardware components used here are CRT interfaced
screen, mouse and keyboard.
Some basic GUI was added to the application for friendly interaction purposes. By
reading to this point you might have noticed that most of the functionalities of this application
are done through the keyboard. The keyboard functions will be described in more details in the
appendix.
This applications main source of communication with the user is the keyboard, which
can be a little bit of a problem for users who do not want to memorize what every single key on
the keyboard does. For that purpose we decided to introduce a pop up menu that will display on
the screen by the users request. This pop-up menu contains almost every single command that
the user can request from the application using the keyboard buttons. All the user has to do is
right click the mouse and it displays all the options.
3.5 DATA FLOW DIAGRAM
Chapter 4
SAMPLE OUTPUTS
Chapter 5
Conclusion:
Creating the interactive program like Halomagic of dinosaur was a very interesting
experience. Using the two different APIs was a very useful part of the program
success. The Halomagic is an interactive 3D program.openGl has given us the
capability to easily create the textures, shadows and reflections of DINOSAUR and
PILLAR and position them in their respective positions. The Halomagic application
has demonstrated how a users input can be processed at a very fast speed and
redisplayed on the screen.
Also my thanks to our lab in charges who set strict guidelines without which our
project wouldnt have been what it is now.
Future Enhancements:
Keyboard interface
Choosing color
Better background
BIBLIOGRAPHY