Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELGAUM - 590014

A CG Mini-Project Report

On

“Dasara Procession”

A Mini-project report submitted in partial fulfillment of the requirements for

the award of the degree of Bachelor of Engineering in Computer Science and Engineering

of Visvesvaraya Technological University, Belgaum.


Submitted by:

NEETHI B.S (1DT17CS059)


POOJA K (1DT17CS063)
Under the Guidance of:

Mrs.Chaitra (Asst. Prof. Dept of CSE)


Mrs.Janhavi(Asst. Prof. Dept of CSE)

Department of Computer Science and Engineering


DAYANANDA SAGAR ACADEMY OF TECHNOLOGY
AND MANAGEMENT
Kanakapura Road, Udayapura, Bangalore

Dept. of CSE,DSATM 2017-21 1 Page


DAYANANDA SAGAR ACADEMY OF TECHNOLOGY AND
MANAGEMENT,
Kanakapura Road, Udayapura, Bangalore
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

CERTIFICATE
This is to certify that the Mini-Project on Computer Graphics (CG) entitled “DASARA
PROCESSION” has been successfully carried out by NEETHI B.S(1DT17CS059) and POOJA
K(1DT17CS063) a bonafide students of Dayananda sagar academy of technology and
management in partial fulfillment of the requirements for the award of degree in Bachelor of
Engineering in Computer Science and Engineering of Visvesvaraya Technological University,
Belgaum during academic year 2017-21. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporated in the report deposited in the departmental library. The
mini project report has been approved as it satisfies the academic requirements in respect of project
work for the said degree.

Dr. C. NANDHINI
(Vice Principal & HOD, Dept. of CSE)

GUIDE:
Mrs.Chaitra
(Asst. Prof. Dept of CSE)

Examiners:

Signature with date :

1.

Dept. of CSE,DSATM 2017-21 2 Page


Dasara procession

ACKNOWLEDGEMENT

It gives us immense pleasure to present before you our project titled “DASARA
PROCESSION”. The joy and satisfaction that accompany the successful completion of any task
would be incomplete without the mention of those who made it possible. We are glad to express
our gratitude towards our prestigious institution DAYANANDA SAGAR ACADEMY OF
TECHNOLOGY AND MANAGEMENT for providing us with utmost knowledge,
encouragement and the maximum facilities in undertaking this project.

We wish to express a sincere thanks to our respected principal Dr. B. R. Lakshmikantha for all
their support.

We express our deepest gratitude and special thanks to Dr.C.Nandini, Vice Principal & H.O.D,
Dept.Of Computer Science Engineering, for all her guidance and encouragement.

We sincerely acknowledge the guidance and constant encouragement of our project guide

Mrs.Janhavi(Assoc. Prof. Dept of CSE) and Mrs.Chaitra (Asst. Prof. Dept of CSE)

POOJA K(1DT17CS063)
NEETHI B.S(1DT17CS059)

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Chapter1

INTRODUCTION
1.1 About Computer Graphics
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.
In computer graphics, pictures or graphics objects are presented as a collection of discrete
picture elements called pixels. The pixel is the smallest addressable screen element
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.
Computer Graphics relies on an internal model of the scene, that is, mathematical
representation suitable for graphical computations. The model describes the 3D shapes, layout
and materials of the scene. This 3D representation then has to be projected to compute a 2D
image from a given viewpoint, this is rendering step. Rendering involves projecting the objects,
handling visibility (which parts of objects are hidden) and computing their appearance and
lighting interactions. Finally, for animated sequence, the motion of objects has to be specified.
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.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Fig 1.1: Graphic System


The image processing can be classified as
 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.

1.2 About OpenGL


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. The
interface consists of over 250 different function calls which can be used to draw complex three-
dimensional scenes from simple primitives. OpenGL was developed by Silicon Graphics Inc.
OpenGL's basic operation is to accept primitives such as points, lines and polygons, and
convert them into pixels. This is done by a graphics pipeline known as the OpenGL state
machine.
Features of OpenGL:
 Geometric Primitives allow you to construct mathematical descriptions of objects.
 Viewing and Modeling permits arranging objects in a 3-dimensional scene, move our
camera around space and select the desired vantage point for viewing the scene to be
rendered.
 Materials lighting OpenGL provides commands to compute the color of any point given
the properties of the material and the sources of light in the room.
 Transformations: rotation, scaling, translations, perspectives in 3D, etc.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

OpenGL Architecture

Fig 1.2: OpenGL Architecture

This is the most important diagram you will see today, representing the flow of graphical
information, as it is processed d from CPU to the frame buffer.

There are two pipelines of data flow. The upper pipeline is for geometric, vertex-based
primitives. The lower pipeline ne is for pixel-based, image primitives. Texturing combines the
two types of primitives together.
1.3 About the Project
Computer graphics involves the designing of objects in different forms which are regular
and irregular in shape. The mini project named “Dasara Procession” creates 2D Mysore
palace, ambari, tableaux, musicians and crowd with day and night mode,giant wheel. This
project is designed and implemented using OpenGL interactive application that basically
deals with providing the graphical interface between the user and the system. Through
keyboard events the movement of musicians, tableaux and ambari along with multiple
elephants have been implemented, which also includes day and night mode of Mysore
palace. Using a drop down menu the color of the Mysore palace and street lights can be
changed.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Chapter 2

REQUIREMENT SPECIFICATION

The requirement specification is a comprehensive description of the software and the


hardware requirements required to run the project successfully.

2.1 Software Requirements


Operating System: Windows XP, Windows 2000

Language Tools: OpenGL

Compiler: GNU GCC compiler/C++ compiler

Documentation Tool: Visual C++ with OpenGL functions

2.2 Hardware Requirements


Processor: Pentium 3 and above
RAM: 1GB with 256MHz

Hard disk: 2MB

Keyboard: Standard 101 key keyboard

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Chapter 3

DESIGN
Design is the planning that lays the basics for the making of every objects or systems.
This chapter involves designing of various aspects and different stages of project. When program
is made to execute, the output window is displayed first. The flow of operation from output
window is shown in figure.

User

Interface

Keyboard Menu Interface

Interface

Change
color in
night to
red.

Key 1 Key 2 Key 3 Key 4 Key 5 Key 6


Change
color in
night to
To show To show blue.
To show To show To show To show
the day the the the ambari the the night
mode of movement movement along with movement mode of
Quit
Mysore of of tableaux. other of ambari Mysore
palace. musicians. elephants. along with palace.
other
m elephants.

Fig 3.1 Design of the project

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Chapter 4

IMPLEMENTATION
Implementation is the stage where all planned activities are put into action. Before the
implementation of a project, the implementer’s (spearheaded by the project committee or
executive) should identify their strength and weaknesses (internal forces), opportunities and
threats (external forces).

Implementation also includes a pseudo code.

4.1 Pseudo code


Void init ()

This function is used to initialize the viewing of the output.

Void elephant ()

This function is used in the construction of an elephant carrying ambari.

Void palace ()

This function is used to draw the palace.

Void chamundihill ()

This function is used to draw the chamundi temple of Mysore.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Void nightpalaceyellow ()

This function is used to draw the night mode of palace in yellow lights.

Void nightpalacered ()

This function is used to draw the night mode of palace in red lights.

Void nightpalaceblue ()

This function is used to draw the night mode of palace in blue lights.

Void elephantpos ()

This function is used to draw the multiple elephants.

Void mykeys ()

This function is used to provide the user interaction.

Void display (){

Color buffer is cleared by using glClear (),

This function displays the bit map characters.

glFlush () guarantees the execution of commands.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

4.2 Flowchart

Start

Main ()

Init ()

Display ()

mykeys () fields()

display1() Key==1 switch()

display2() Key==2 Display5up()

display3() Key==3 Display5down()

Quit
A

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

display4() Key==4

Key==5

Display5()

Fig 4.2.1: Control flow of the project

4.3 Functions used:

4.3.1 Headers defined


The inbuilt functions are defined in the OpenGL library. Some of the headers that are used
are as follows.

 #include<stdio.h>:To take input from standard input and write it to standard output.
 #include<GL/glut>:To include glut library functions.
 #include<math.h>:To define common mathematical functions.

4.3.2 User defined functions used in the project

 elephant(): This function is used to draw an elephant carrying ambari

 palace(): This function is used to draw the palace.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

 chamundihill(): This function is used to draw the chamundi temple of Mysore.

 nightpalaceyellow(): This function is used to draw night mode of palace in yellow lights.

 nightpalacered(): This function is used to draw night mode of palace in red lights.

 nightpalaceblue (): This function is used to draw night mode of palace in blue lights.

 elephantpos(): This function is used to draw multiple elephants.

 elephant1 (): This function is used to draw an elephant.

 fence(): This function is used to draw the fence.

 grass(): This function is used to draw the grass.

 roads(): This function is used to draw the roads.

 footpath(): This function is used to draw the footpath.

 mud(): This function is used to draw the mud.

 sky(): This function is used to draw the sky.

 streetlights(): This function is used to draw the street lights.

 circle1(): This function is used to draw the circle.

 sun1 (): This function is used to draw the sun.

 clouds (): This function is used to draw the cloud.

 streetlightnight(): This function is used to draw the yellow colored street lights in night
mode.

 streetlightnightred(): This function is used to draw the red colored street lights in night
mode.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

 streetlightnightblue(): This function is used to draw the blue colored street lights in
night mode.

 nightfence(): This function is used to draw the fence in night mode.

 moon(): This function is used to draw the moon.

 stars(): This function is used to draw a star.

 disstars(): This function is used to draw the multiple stars.

 nightroad():This function is used to draw the roads in night mode.

 translate(): This function is used to move the musicians.

 translate2(): This function is used to move the ambari along with other elephants.

 translate3(): This function is used to move the stabdhachitra.

 night1y(), night1r(), nightb(): This function is used to draw the side walls and dooms in
yellow, red, blue respectively.

 night2y(), night2r(), night2b(): This function is used to draw the central portion of side
walls in yellow, red, blue respectively.

 night3y(), night3r(), night3b(): This function is used to draw the central portion of the
palace in yellow, red, blue respectively.

 night4y(), night4r(), night4b(): This function is used to draw four dwarakas in yellow,
red, blue respectively.

 night5y(), night5r(), night5b(): This function is used to draw small dwarakas beside
main dwaraka in yellow, red, blue respectively.

 night6y(), night6r(), night6b(): This function is used to draw the main dwaraka in
yellow, red, blue respectively.

 insidebox(): This function is used to draw the windows of the palace.

 hillpos(): This function is used to translate the tableaux.


Dept. of CSE DSATM, Bangalore 2019-20
Dasara procession

 chariote():This function is used to draw the tableaux of musical instruments.

 charioteele():This function is used to draw the elephant that moves the chariote.

 colors(int id): This function is used to choose the menu entries.

 flute(): This function is used to draw the flute.

 man(): This function is used to draw the man.

 man1(): This function is used to draw the man.

 musicians(): This function is used to draw the musician.

 multiplemusicians(): This function is used to draw the multiple musicians.

 multipleman():This function is used to draw men.

 scaleman(): This function is used to draw the crowd.

 tr(): This function is used to draw the multiple trees.

 tree(): This function is used to draw a tree.

4.3.3 Standard library functions used in the project:

 glutInit (int *argc, char **argv): glutInit is used to initialize the GLUT library.

 glutInitDisplayMode(unsigned int mode):glutInitDisplayMode sets the initial display


mode.

 glutInitWindowPosition(intx,int y): Specifies the initial position of the top-left corner


of the window in pixels.

 glutInitWindowSize(intwidth,int height): Specifies the initial height and width of the


window in pixels.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

 glutKeyboardFunc (void *f(char key,intwidth,int height):KeyboardFunc sets the


keyboard callback for the current window.

 glClear():The clear function clears buffers to preset values.

 glClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a):The glClearColor


function specifies clear values for the color buffers.

 glMatrixMode(GLenum mode):This function specifies which matrix is the current


matrix.

 glLoadIdentity(): Set the current transformation matrix to an identity matrix.

 glPushMatrix(),glPopMatrix(): This pushes to and pops from the matrix stack


corresponding to the current matrix mode.

 glPointSize():The glPointSize function specifies the diameter of rasterized points.

 glTranslate[fd](TYPE x,TYPEy,TYPE z): This function multiplies the current matrix


by a translation matrix.

 gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top):The


gluOrtho2D function defines a 2-D orthographic projection matrix.

 glBegin (glEnum mode): It initiates a new primitive of type mode and starts the
collection of vertices. Values of mode include GL_POINTS, GL_LINES,
GL_LINE_STRIP, and GL_POLYGON.

 glEnd(): It terminates a list of vertices.

 glFlush ():It forces any buffered openGL commands to execute.

 glutMainLoop() :Itcauses the program to enter an event processing loop.

 glutDisplayFunc(void (*func)(void)):It registers the display function ‘func’ that is


executed when the window needs to be redrawn.

 glutCreateMenu(void (*f)(void)): It returns an identifier for a top-level menu and


registers the callback function f that returns an interger value corresponding to the menu
entry selected.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

SOURCE CODE (FIRST 100 LINES)


#include<windows.h>
#include<stdio.h>
#include<stdlib.h>
#include<GL/glut.h>
#include<math.h>
# define M_PI 3.142
GLfloat angle=0.0;
void tree()//tree function
{
glColor3f(0.36,0.250,0.20);
glBegin(GL_POLYGON);
glVertex2i(300,0);
glVertex2i(310,0);
glVertex2i(310,50);
glVertex2i(300,50);
glEnd();
glColor3f(0.0,0.3,0.0);
glBegin(GL_POLYGON);
glVertex2i(305,150);
glVertex2i(290,50);
glVertex2i(320,50);
glEnd();
}
void tr() //tree function
{
glPushMatrix();
glTranslatef(-280,500,0);
tree();
glPopMatrix();
glPushMatrix();
Dept. of CSE DSATM, Bangalore 2019-20
Dasara procession

glTranslatef(-220,500,0);
tree();
glPopMatrix();
glPushMatrix();
glTranslatef(600,500,0);
tree();
glPopMatrix();
glPushMatrix();
glTranslatef(650,500,0);
tree();
glPopMatrix();
}
void sky()
{
glColor3f(0.6,0.9,0.99);
glBegin(GL_POLYGON);
glVertex2i(0,0);
glVertex2i(0,999);
glVertex2i(999,999);
glVertex2i(999,0);
glEnd();
}

glVertex2f(570,210);
glVertex2f(720,210);
glVertex2f(720,180);
glEnd();
//temple
glColor3f(0.8,0.9,0.0);
glBegin(GL_POLYGON);

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Chapter 5

SNAPSHOTS
A snapshot is the state of the system at a particular point in time. It can refer to the actual
copy of a state of a system or to a capability provide by systems.

Fig 5.1: Day mode of Mysore palace


This snapshot shows the day mode of Mysore palace.

Fig 5.2: Movement of musicians

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

This snapshot shows the movement of musicians where one group playing drums and other
group playing flute.

Fig 5.3: Movement of tableaux

This snapshot shows the movement of tableaux and chariot containing musical instruments
which is moved by the elephant.

Fig 5.4: Static view of ambari along with other elephants

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

This snapshot shows the static view of ambari along with other elephant

Fig 5.5: Movement of ambari along with other elephants

This snapshot shows the movement of ambari along with other elephants.

Fig 5.6: Night mode of Mysore palace

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

This snapshot shows the night mode of the Mysore palace with yellow lightings of palace and
streetlights.

Fig 5.7: Night mode of Mysore palace


This snapshot shows the night mode of the Mysore palace with red lightings of palace
and streetlights using pop up menu.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Fig 5.8: Night mode of Mysore palace

This snapshot shows the night mode of the Mysore palace with blue lightings of palace and
streetlights using pop up menu.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

Chapter 6

CONCLUSION AND FUTURE ENHANCEMENTS

6.1 Conclusion

The Dasara Procession Graphics package has been developed Using OpenGL. The main idea of
the program is to show how the Dasara Procession takes place through the keyboard interaction,
which includes day and night mode of Mysore palace, and movement of musicians, tableaux and
ambari along with multiple elephants. Further, we can change the colors in the night mode using
pop up menu.

6.2 Future Enhancements


The project has graphical usage where in different functions which can be applicable in graphical
packages are used. The applications developed so far is in its basic working stage. There can be
more enhancements like

 Designing of a detailed 3D Mysore palace with complex interior structures.


 Adding the capabilities of lighting, shadows and camera view.
 By providing mouse based interaction to every display.
 We can also change the color and provide more effects.

Dept. of CSE DSATM, Bangalore 2019-20


Dasara procession

BIBILOGRAPHY

BOOKS
[1] Edward Angel: Interactive Computer Graphics A Top-Down Approach with OpenGL, 5th
Edition, Pearson Education, 2008.
[2] Donald Hearn and Pauline Baker: Computer Graphics- OpenGL Version, 3rd Edition,
Pearson Education, 2008.
[3] F.S Hill Jr.: Computer Graphics Using OpenGL, 3rd Edition, PHI, 2009.

WEBSITES
[1] http://www.opengl.org/resources/libraries/glut/
[2] http://www.opengl.ord/
[3]http://en.wikipedia.org/wiki/opengl

Dept. of CSE DSATM, Bangalore 2019-20

You might also like