100% found this document useful (1 vote)
631 views

CG Final Report

The document discusses computer graphics, its history and applications. It describes OpenGL and some of its built-in functions. Computer graphics is used to represent and manipulate images through various technologies to create visual content. OpenGL is a widely used graphics API that brings applications to different platforms and fosters innovation.

Uploaded by

Subramani M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
631 views

CG Final Report

The document discusses computer graphics, its history and applications. It describes OpenGL and some of its built-in functions. Computer graphics is used to represent and manipulate images through various technologies to create visual content. OpenGL is a widely used graphics API that brings applications to different platforms and fosters innovation.

Uploaded by

Subramani M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belgaum-590014

A COMPUTER GRAPHICS Mini Project Report


On

“THIRSTY CROW”

Submitted in Partial fulfilment of the Requirements for the VI Semester of the Degree of

Bachelor of Engineering
In
Computer Science & Engineering
By
KEERTHANA L (1CE20CS043)
V MANOJ KUMAR (1CE20CS083)

Under the Guidance of


Prof. SWETHA A
Asst. Professor, Dept. of CSE

CITY ENGINEERING COLLEGE


Doddakallasandra, Kanakapura Road,
Bengaluru-560061
CITY ENGINEERING COLLEGE
Doddakallasandra, Kanakapura Road, Bengaluru-560061

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

Certified that the COMPUTER GRAPHICS Mini Project work entitled “THIRSTY CROW” has
been carried out by KEERTHANA L (1CE20CS043), V MANOJ KUMAR (1CE20CS083),
Bonafede students of City Engineering College in partial fulfilment for the award of Bachelor of
Engineering in Computer Science and Engineering of the Visveswaraya Technological
University, Belgaum during the year2022-2023. It is certified that all corrections/suggestion
indicated for Internal Assessment have been incorporated in the Report deposited in the
departmental library. The COMPUTER GRAPHICS Mini Project Report has been approved as it
satisfies the academic requirements in respect of project work prescribed for the said Degree.

Prof. SWETHA A Dr. SOWMYA NAIK Dr.THIPPESWAMY H N


Asst.Prof, Dept.of CSE Head, Dept. of CSE Principal

External Viva

Name of the examiners Signature with date

1.
2.
ABSTRACT

OpenGL is the industry’s most widely used and supported 2D and 3D graphics application
programming interface (API), bringing thousands of applications to a wide variety of computer
platforms. OpenGL fosters innovation and speeds application development by incorporating a broad
set of rendering, texture mapping, special effects, and other powerful visualization functions.

OpenGL support this modelling capability as OpenGL has additional features to better produce
something more realistic. OpenGL allows us to create a graph that can be run on any operating system
with only minor adjustments.

The 3-D graphics package designed here provides an interface for the users for handling the display
and manipulation of 3D viewing model of a Building. Keyboard and mouse are the main input devices
used.

This project, “THIRSTY CROW” aims at drawing a virtual story of thirsty crow. This project includes
objects like the Crow, Pot, Tree, Cactus, Sun, Desert, and Stone. The project includes crow movement
where the viewer can move crow from tree to pot then potto stone and vice versa by using keyboard
buttons. This project will motivate us “IF YOU ARE DETERMINED ENOUGH, YOU CAN FIND
A WAY TO ACHIEVE WHAT YOU WANT”.
ACKNOWLEDGEMENT

While presenting this COMPUTER GRAPHICS Mini Project on “Thirsty crow” we feel that it is my duty to
acknowledge the help rendered to me by various persons.

Firstly, We are grateful to our institution City Engineering College for providing us a congenial atmosphere to
carry out the project successfully.

We would like to express my heartfelt gratitude to Dr. Thippeswamy H N, Principal, CEC, Bangalore, for
extending his support.

We would also like to express my heartfelt gratitude to Prof. Sowmya Naik, HOD, Computer Science and
Engineering whose guidance and support was truly invaluable.

We are very grateful to my guide, Prof. Swetha A, Asst. Prof. Department of Computer Science, for her able
guidance and valuable advice at every stage of my project which helped me in the successful completion of our
project.

We would also have indebted to my Parent and Friends for their continued moral and material support
throughout the course of project and helping me in finalize the presentation.

Our hearty thanks to all those who have contributed bits, bytes and words to accomplish
this Project.

KEERTHANA L(1CE20CS043)
V MANOJ KUMAR (1CE20CS083)
TABLE OF CONTENTS

CHAPTER. NO. CHAPTER NAME PAGE NO .

ACKNOWLEDGEMENT

ABSTRACT

1. INTRODUCTION…………………………………………… 1

1.1 About Computer Graphics ……………………………… 1


1.2 History of Computer Graphics………………………….. 2
1.3 About OpenGL ……………………………………………3
1.4 Application of Computer Graphics………………………..4
1.5 Built-in Function in OpenGL ..............................................6
1.6 Mouse Functions………………………………………… 7

2. LITERATURE SURVEY……………………………………..9

3. SYSTEM REQUIREMENT SPECIFICATION........................11

3.1 Hardware Requirements.......................................... ............11

3.2 Software Requirements........................................................11

4. SYSTEM ANALYSIS AND DESIGN… .................................12

4.1 System Analysis...................................................................12

4.2 System Design......................................................................12

5. IMPLEMENTATION ...............................................................13

5.1 Description of Implementation Modules..............................13

5.2 List of Implementation Functions.........................................13

5.3 Description of inbuilt Functions ..........................................14

6. SNAPSHOTS…………………………………………….........15

APPENDIX……………………………………………..…......19

CONCLUSION AND FUTURE SCOPE……..…………....… 22

REFERENCES…………………………….…………...…….. 23
LIST OF FIGUREES

FIGURE NO. FIGURE NAME PAGE NO

1.1 Library Organization................................................. 4

6.1 Description Window................................................. 15

6.2 Story Page And Instruction ...................................... 15

6.3 Crow is going near pot...............................................16

6.4 Crow reached near pot ..............................................16

6.5 Crow checking pot ....................................................17

6.6 Crow came with idea ................................................17

6.7 Crow put the stone in pot...........................................18

6.8 Crow drink the water .................................................18

..
THRISTY CROW

CHAPTER 1

INTRODUCTION

1.1About Computer Graphics


The term computer graphics has been used in a broad sense to describe almost everything on computers that is
not text or sound. Typically, the term computer graphics refers to several different things:

• The representation and manipulation of image data by a computer


• The various technologies used to create and manipulate images
• The sub-field of Computer Science which studies methods for digitally Synthes sizing and
manipulating visual content.

Today, computer graphics is widespread. Such imagery is found in and on television, newspapers, weather
reports, and in a variety of medical investigations and surgical procedures. A well-constructed graph can present
complex statistics in a form that is easier to understand and interpret. In the media such graphs are used to
illustrate papers, reports and other presentation material.

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.

Using this editor, you can draw and paint using the mouse. It can also perform a host of other functions like
drawing lines, circles, and polygons and so on. Interactive picture construction techniques such as basic
positioning methods, rubber-band methods, dragging and drawing are used. Block operations like cut, copy and
paste are supported to edit large areas of the workspace simultaneously. It is user friendly and intuitive to use.

Graphics provides one of the most natural means of communicating with a computer, since our highly developed
2D Or 3D pattern-recognition abilities allow us to perceive and process pictorial data rapidly. Computers have
become a powerful medium for the rapid and economical production of pictures. Graphics provide a so natural
means of communicating with the computer that they have become widespread. Interactive graphics is the most
important means of producing pictures since the invention of photography and television. We can make pictures
of not only the real-world objects but also of abstract objects such as mathematical surfaces on 4D and of data
that have no inherent geometry. A computer graphics system is a computer system with all the components of

Dept.CSE,CEC 2022-2023 Page1


THRISTY CROW

the general-purpose computer system. There are five major elements in system: input devices, processor,
memory, frame buffer and output devices

There are different types of Graphics architectures which are:

• Display processors: The earliest attempts to build special purpose graphics system were concerned
primarily with relieving the general-purpose computer from the task of refreshing the display
continuously. These display processors had conventional architecture but included instructions to
display primitives on the CRT.
• Pipeline architectures: The availability of inexpensive solid-state memory led to the universality of
raster display. For computer graphics applications, the most important use of custom VLSI circuits has
been in creating pipeline architectures.
• Graphics pipeline: Each object comprises a set of graphical primitives. Each primitive comprises set
of vertices.
• Vertex processing: The assignment of vertex color scan as simple as program specifying a color or as
complex as computation of a color from a physically realistic lightning model that incorporates the
surface properties of the object and the characteristic light sources in the scene.
• Clipping and primitive assembly: We must do clipping because of the limitations of that no imaging
system can see the whole world at once. The human retina has a limited size corresponding to an
approximately 90-degreed field of view.

1.2History of Computer Graphics

William fetter was credited with coning the term Computer Graphics in 1960, to describe his work at Boeing.
One of the first displays of computer animation was future world (1976), which included an animation of a
human face and hand-produced by Carmel and Fred Parel 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.

1.3About 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 3D scenes from simple primitives. 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, where it competes with direct 3D
on Microsoft Windows platforms. OpenGL is managed by the non-profit technology consortium, the khronos
group, Inc. OpenGL serves two main purposes:

Dept.CSE,CEC 2022-2023 Page2


THRISTY CROW

• To hide the complexities of interfacing with different 3D accelerators, by presenting programmer with
a single, uniform API.
• To hide the differing capabilities of hardware platforms, by requiring that all Implementations support
the full OpenGL, feature set.

OpenGL has historically been influential on the development of 3D accelerator, promoting a base level of
functionality that is now common in consumer level hardware:

• Rasterized points, lines and polygons are basic primitives.


• A transform and lighting pipeline.
• Z buffering.
• Texture Mapping.
• Alpha.
• Blending.

OpenGL is the premier environment for developing portable, interactive 2D and 3D graphics applications. Since
its introduction in 1992, OpenGL has become the industry's most widely used and supported 2D and 3D graphics
application programming interface (API), bringing thousands of applications to a wide variety of computer
platforms. OpenGL fosters innovation and speeds application development by incorporating a broad set of
rendering, texture mapping, special effects, and other powerful visualization functions. Developers can leverage
the power of OpenGL across all popular desktop and workstation platforms, ensuring wide application
deployment.

OpenGL Available Everywhere: Supported on all UNIX® workstations, and shipped standard with every
Windows 95/98/2000/NT and Mac OS PC, no other graphics API operates on a wider range of hardware
platforms and software environments. OpenGL runs on every major operating system including Mac OS, OS/2,
UNIX, Windows 95/98, Windows 2000, Windows NT, Linux, Open Step, and BeOS; it also works with every
major windowing system, including Win32, Mac OS, Presentation Manager, and X-Window System. OpenGL
is callable from Ada, C, C++, FORTRAN, Python, Perl and Java and offers complete independence from
network protocols and topologies. The OpenGL interface: Our application will be designed to access OpenGL
directly through functions in three libraries namely-

❖ GL
❖ GLU
❖ Glut

Dept.CSE,CEC 2022-2023 Page3


THRISTY CROW

GLU

OpenGL GL

Application Frame

Program GLUT Buffer

Xlib,Xtk

GLX

Figure 1.1: Library Organization

1.4 Applications of Computer Graphics:

(1) Video games:

➢ These games require human interaction with the User Interface for making nice visual result on the
Video Device

(2) Education Field:

➢ In the learning process, acquiring knowledge and skills required for better career path CG is needed.
So Computer generated models in economic, financial and physical systems are often used.
➢ We regularly love to have computerized model to understand any topic easily. Equipment,
Physiological systems, physical systems are coded using CG.

(3) Computer Aided Design (CAD):

➢ Most of engineering and Architecture students are concerned with Design. CAD is used to design
various structures such as Computers, Aircrafts, Building, in almost all kinds of Industries (where
designing is necessary)
➢ After making a full diagram, we can even see its animation (Operation and working of a Product)

(4) Computer Arts:

Dept.CSE,CEC 2022-2023 Page4


THRISTY CROW

➢ If we are intelligent enough, we can rock by making creative arts using these Graphics tools. For
making these arts we generally use CAD packages, paint and Paint brush programs and in animation
too
➢ Computer Arts Examples include Logo design (for companies, college, Industries, Institutions),
Cartoon drawing, Product advertisements and many.

(5) Simulation:

➢ Using CG graphics reproduction or duplicating already existing thing will be done. For Instance, if we
go for the Flight simulators, these computer-generated images are very much needed for training pilots
to understand easily (learning standard methods)

(6) Entertainment:

➢ When we talk about Entertainment, immediately movies and games get in to picture.CG are mostly
used in music videos, motion pictures, cartoon animation films. For finding out tricks to be used in
Games, for its interactivity we often use CG

(7) Image Processing: (Medical)

➢ In Medical field, concerning Image Processing CG is used to various technologies to interpret already
existing pictures and is useful to modify Photographs and TV scans.

Basically, CG is used to improve the picture quality, and visualizing effects. Some of its
applications includes-

i). Tomography

ii). Ultrasonic medical scanners

iii). Picture enhancements

(8) User Interfaces (Graphical User Interfaces):

❖ CG is effectively used to make Menus, Icons (Graphical Symbols),to make window


manager(multiple windows).And Some of the Graphic packages includes PHIGS,
Graphics Kernel System, Painting and drawing.
Some of the other applications are: -
➢ Scientific and Business Visualization
➢ Graphic Presentation
➢ Graphic Design
➢ Web Designing

Dept.CSE,CEC 2022-2023 Page5


THRISTY CROW

➢ Computational Physics
➢ Information Visualization
➢ Display of Information
➢ Information Architecture
➢ Genetics, Molecular Biology, Neuroscience, Animation, Statistics
➢ Desktop Publishing.

1.5 Built-In Functions:

(1) glColor3f (float, float, float):-


This function will set the current drawing colour.
(2) gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top):-
Which defines a two-dimensional viewing rectangle in the plane z=0.
(3) glClear ( ):-
Takes a single argument that is the bitwise OR of several values indicating which buffer is to
be cleared.
(4) glClearColor ():-
Specifies the red, green, blue, and alpha values used by glClear to clear the color buffers.
(5) glLoadIdentity ( ):-
Sets the current matrix to an identity matrix.
(6) glMatrixMode (mode):-
Sets the current matrix mode, mode can be GL_MODELVIEW, GL_PROJECTION or
GL_TEXTURE.
(7) glutInit (int *argc, char**argv):-
Initializes GLUT, the arguments from main are passed in and can be used by the application.
(8) glutInitDisplayMode (unsigned int mode):-
Request a display with the properties in mode. The value of mode is determined by the logical
OR ofoptions including the color model and buffering.
(9) glutInitWindowSize (int width, int height):-
Specifies the initial position of the top-left corner of the window in pixels
(10) glutCreateWindow (char *title):-
A window on the display. The string title can be used to label the window. The return value
provides references to the window that can be used when there are multiple windows.
(11) glutMouseFunc(void *f(int button, int state, int x, int y):-

Dept.CSE,CEC 2022-2023 Page6


THRISTY CROW

Register the mouse callback function f. The callback function returns the button, the state of
button after the event and the position of the mouse relative to the top-left corner of the
window.
(12) Void glutKeyboardFunc(void(*func) (void)):-
This function is called every time when you press enter key to resume the game or when you
press ‘b’ or ‘B’ key to go back to the initial screen or when you press esc key to exit from the
application.
(13)glutDisplayFunc (void (*func) (void)):-
Register the display function that is executed when the window needs to be redrawn.
(14) glutSpecialFunc(void(*func)( void)):-
This function is called when you press the special keys in the keyboard like arrow keys,
function keys etc. In our program, the function is invoked when the up arrow or down arrow
key is pressed for selecting the options in the main menu and when the left or right arrow key
is pressed for moving the object(car) accordingly.
(15) glut PostReDisplay ( ) :-
Which requests that the display callback be executed after the current callback returns.
(16) Void MouseFunc (void (*func) void)):-
This function is invoked when mouse keys are pressed. This function is used as an alternative
to the previousfunction i.e., it is used to move the object(car) to right or left in our program by
clicking left and right button respectively.
(17) glutMainLoop() :-
Cause the program to enter an event-processing loop. It should be the last statement in main
function.

1.6 Mouse Functions:


Right button: controls the below options.
➢ No wind option: wind mills doesn’t rotate.
➢ Wind CW option: wind mills move in clockwise direction.
➢ Wind ACW option: wind mills move in anticlockwise direction.
➢ Fast wind CW option: moves faster in clockwise direction.
➢ Fast wind ACW option: moves faster in anticlockwise direction.
➢ Fast wind ACW option: moves faster in anticlockwise direction.
➢ Quit option: used to quit the above operations.

Dept.CSE,CEC 2022-2023 Page7


THRISTY CROW

When the project is made to run, we can initially start the wind mills in
clockwise direction by selecting Wind CW option. We have to select Wind ACW option
for anticlockwise moving, and then we have to select Fast Wind CW for faster moving
with clockwise direction and Fast Wind ACW foe faster moving with anticlockwise
direction and finally for quit that operation we have to select Quit option and end the
project

Dept.CSE,CEC 2022-2023 Page8


THRISTY CROW

CHAPTER 2

LITERATURE SURVEY
➢ Computer graphics started with the display of data on hardcopy plotters and cathode ray tube
(CRT) screens soon after the introduction of computers.
➢ Computer graphics today largely interactive, the user controls the contents, structure, and
appearance of objects and of displayed images by using input devices, such as keyboard
mouse, or touch-sensitive panel on the screen. Graphics based user interfaces allow millions
of new users to control simple, low- cost application programs, such as spreadsheets, word
processors, and drawing programs.
➢ 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. (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, where it
competes with Direct3D on Microsoft Windows platforms (see Direct3D vs. OpenGL).
OpenGL is managed by the non-profit technology consortium, the Khronos Group.
➢ In the 1980s, developing software that could function with a wide range of graphics hardware
was a real challenge. By the early 1990s, Silicon Graphics (SGI) was a leader in 3D graphics
for workstations. SGI's competitors (including Sun Microsystems, Hewlett- Packard and IBM)
were also able. In addition, SGI had a large number of software customers; by changing to the
OpenGL API they planned to keep their customers locked onto SGI (and IBM) hardware for a
few years while market support for OpenGL matured to bring to market 3D hardware,
supported by extensions made to the PHIGS standard. In 1992, SGI led the creation of the
OpenGL architectural review board (OpenGL ARB), the group of companies that would
maintain.
➢ OpenGL specification took for years to come. On 17 December 1997, Microsoft and SGI
initiated the Fahrenheit project, which was a joint effort with the goal of unifying the OpenGL
and Direct3D interfaces(and adding a scene-graph API too). In 1998 Hewlett- Packard joined
the project. It initially showed some promise of bringing order to the world of interactive 3D
computer graphics APIs, but on account of financial constraints at SGI, strategic reasons at
Microsoft, and general lack of industry support, it was abandoned in 1999.

Dept.CSE,CEC 2022-2023 Page9


THRISTY CROW

➢ Many openGL functions are used for rendering and transformation purposes. Transformations
functions like glRotate (), glTranslate (), glScaled () can be used.
➢ OpenGL provides a powerful but primitive set of rendering command, and all higher-level
drawing must be done in terms of these commands. There are several libraries that allow you
to simplify your programming tasks, including the following:
➢ OpenGL Utility Library (GLU) contains several routines that use lower-level OpenGL
commands to perform such tasks as setting up matrices for specific viewing orientations and
projections and rendering surfaces.
➢ OpenGL Utility Toolkit (GLUT) is a window-system-independent toolkit, written by Mark
Kill guard, to hide the complexities of differing window APIs.
➢ To achieve the objective of the project, information related to the light sources is required with
OpenGL we can manipulate the lighting and objects in a scene to create many different kinds
of effects. It explains how to control the lighting in a scene, discusses the OpenGL conceptual
model of lighting, and describes in detail how to set the numerous illumination parameters to
achieve certain effects and this concept is being obtained.
➢ To demonstrate the transformation and lightening, effects, different polygons have to be used.
Polygons are typically drawn by filling in all the pixels enclosed within the boundary, but we
can also draw them as outlined polygons or simply as points at the vertices. This concept is
obtained from.
➢ The properties of a light source like its material, diffuse, emissive, has to mention in the
project. So to design the light source and the objects, programming guide of an OpenGL is
used.

Dept.CSE,CEC 2022-2023 Page10


THRISTY CROW

CHAPTER 3

SYSTEM REQUIREMENT SPECIFICATION

3.1Hardware Requirements:
Minimum hardware specification-
➢ Processor: Pentium processor
➢ Memory: 32MB RAM.
➢ Hard Disk:40GB Hard disk
➢ Interface Device: Mouse, Keyboard, Monitor of Resolution 1920X1080

3.2 Software Requirements:


Minimum software specification-
➢ Operating system: ubuntu / Windows
➢ Programming language-C++
➢ Compiler (g++)
➢ OpenGL library

Dept.CSE,CEC 2022-2023 Page11


THRISTY CROW

CHAPTER 4

SYSTEM ANALYSIS AND DESIGN

4.1System Analysis

In this project we are mainly concentrating on using keyboard .

❖ Start-up: Click on ‘spacebar’ to


start the project .

❖ Click on ‘1 to 9’ for story


execution.

❖ End : Click on ‘ESC’ to stop the project.

4.1 System Design

The main function calls the following functions:

glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);

glutInitWindowPosition(0,0);

glutInitWindowSize(1920,10);
glutCreateWindow("Thirsty Crow");
init();
glutKeyboardFunc(keyAction);
glutReshapeFunc(reshape);
glutDisplayFunc(welcomeisplay);
glutMainLoop();

Dept.CSE,CEC 2022-2023 Page12


THRISTY CROW

CHAPTER 5

IMPLEMENTATION

5.1 Description of Implementation Modules

In this project a thirsty crow is created using “OpenGL” functional API by the help of
built in functions present in the Opengl lib. These functions provide us the efficient way
to design the project. In this chapter we are describing the functionality of our project
using these functions, such as Opengl translation and other geometric transformations.

5.2 List of Implementation Functions

User Defined Functions


void keyAction(unsigned char key ,int x ,int y)

This function is used to add the keyboard listener in an OpenGL.


void display(void)

This function handles the animation and the redrawing of the graphics window contents.

void init(void)

This function initializes OpenGL’s rendering modes.

void reshape(int w, int h)

This function is used to change the size of Window as per the requirements.
Void movement(void)

This function is used to control the movement of crow from tree to pot then pot to
stone andvice versa.
int main(int argc, char ** argv)

The program begins execution from this function.

Dept.CSE,CEC 2022-2023 Page13


THRISTY CROW

5.1 Description of inbuilt functions

main():
The execution of the program starts from the main().

glutInit():
Initializes GLUT. The argument from main are passed in and can be
used by theapplication.

glutInitWindowSize():
Specifies the initial height and width of the window in pixels.

glutCreateWindow():
Creates the window on the display. The string can be used to label the window.

glutDisplayFunc():
Registers the display function that is executed when the window needs to redraw.

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

init():
This function is defined to initialize the window parameters.

Dept.CSE,CEC 2022-2023 Page14


THRISTY CROW

CHAPTER 6

SNAPSHOTS

Fig 6.1: Shows the front page of the mini project which gives the description

Fig 6.1: Description Window.

Fig 6.2:Shows the graphics of tree allignment

Fig 6.2. Story Page and instruction for continuing animation.

Dept.CSE,CEC 2022-2023 Page15


THRISTY CROW

Fig 6.3:Shows thirsty crow searching for water

Fig 6.3: Crow is going near pot.

Fig 6.4: Shows thirsty crow searching for water

Fig 6.4: Crow reached near pot.

Dept.CSE,CEC 2022-2023 Page16


THRISTY CROW

Fig 6.5: shows thirsty crow reached near to pot and checking for water

Fig 6.5: Crow checking pot but water is very less. He is not able to reach.

Fig 6.6: thirsty crow come up with an idea and go to pick the stone

Fig 6.6: Crow came with idea and go to pick the stone.

Dept.CSE,CEC 2022-2023 Page17


THRISTY CROW

Fig 6.7: shows thirsty crow put the stone repeatedly to level up the water

Fig 6.7: Crow put the stone repeatedly

Fig 6.8: Thirsty crow drink the water and went back to the tree.

Fig 6.8: Crow drink the water and went back to the tree.

Dept.CSE,CEC 2022-2023 Page18


THRISTY CROW

APPENDIX

Pseudo code:
void Bird()
{
glBegin(GL_POLYGON);
glColor3ub(0,0,0 );
glVertex2f(-0.5,0.15);
glVertex2f(-0.3,0.25);
glVertex2f(-0.1,0.15);
glVertex2f(-0.3,0.09);

glEnd();
//WING ONE
glBegin(GL_POLYGON);
glVertex2f(-0.4,0.2);
glVertex2f(-0.4,0.25);
glVertex2f(-0.25,0.35);
glVertex2f(-0.3,0.28);
glVertex2f(-0.35,0.2);
glEnd();
//WING TWO
glBegin(GL_POLYGON);
glVertex2f(-0.4,0.20);
glVertex2f(-0.2,0.31);
glVertex2f(-0.1,0.22);
glEnd();
//LIP
glBegin(GL_LINES);
glColor3ub(0,0,0 );
glVertex2f(-0.55,0.1);
glVertex2f(-0.49,0.15);
glVertex2f(-0.55,0.1);

Dept.CSE,CEC 2022-2023 Page19


THRISTY CROW

glVertex2f(-0.48,0.14);
glVertex2f(-0.48,0.14);
glVertex2f(-0.5,0.1);
glVertex2f(-0.5,0.1);
glVertex2f(-0.45,0.15);
glEnd();
//TAIL
glLineWidth(2);
glBegin(GL_LINES);
glVertex2f(-0.15,0.15);
glVertex2f(-0.08,0.15);
glEnd();

//EYE
glPointSize(25.0);
glTranslatef(-0.45f,0.18f,0);
glBegin(GL_POINTS);
glColor3ub(0,0,0 );
glVertex2f(-0.0f, -0.0f);
glEnd();
int triangleAmount = 20;
GLfloat k=-.009f; GLfloat l=.0f;
GLfloat radius =.01f;
GLfloat twicePi = 2.0f * PI;
glBegin(GL_TRIANGLE_FAN);
glColor3ub(255, 255, 255);
glVertex2f(k, l); // center of circle
for(int i = 0; i <= triangleAmount;i++) {
glVertex2f(
k + (radius * cos(i * twicePi / triangleAmount)),
l+ (radius * sin(i * twicePi / triangleAmount))
);
}
glEnd();

Dept.CSE,CEC 2022-2023 Page20


THRISTY CROW

if(febbleflag)
{
radius =.02f;
twicePi = 2.0f * PI;
GLfloat m=-.075f; GLfloat n=-0.075f;
glBegin(GL_TRIANGLE_FAN);
glColor3ub(107, 101, 93);
glVertex2f(m, n); // center of circle
for(int i = 0; i <= triangleAmount;i++) {
glVertex2f(
m + (radius * cos(i * twicePi / triangleAmount)),
n+ (radius * sin(i * twicePi / triangleAmount))
);
}
glEnd();
}

}
void fullsky()
{
glLoadIdentity();
glBegin(GL_POLYGON);
glColor3ub(155, 215, 232);
glVertex2f(-1.0f, 1.0f);
glVertex2f(1.0f, 1.0f);
glVertex2f(1.0f, 0.1f);
glVertex2f(-1.0f, 0.1f);
glEnd();
}

Dept.CSE,CEC 2022-2023 Page21


THRISTY CROW

CONCLUSION AND FUTURE SCOPE

Conclusion:
OpenGL software was used to develop “INTERACTION BETWEEN LAYERS OF OSI MODEL” project
which provided various commands to specify objects and operations in two-dimensional space. The very
purpose of developing this project is to exploit the strength of OpenGL graphic capabilities and to illustrate the
character movement and dialogue delivery of characters.

This project helped me learn a lot about the proper utilization of various graphics library functions that are
defined in GLUT, GLU and GL. The package can be used for educational purposes to demonstrate the various
curves, area filling algorithm, non-convex polygon and other OpenGL Primitives.

This project designed showcases the animation of Thirsty Crow which tell us the story of a crow which is very
thirsty. We learned from the story that we should never give up in any situation, and try our best to overcome
the difficult situation. Here, the user can interact with project with the help of keyboard buttons. From this
project, I learnt how the OpenGL is useful in the field of animation, education and gaming. Hence it is useful to
us for taking up this field as our career and develop someother outstanding features in OpenGL and provide a
token of contribution to the world of graphics.

So, we conclude on note that we are looking forward to develop more such projects with an appetite to learn
more in computer graphics.

Future scope:

The currently developed project can improve in many areas. Time constraint and deficientknowledge has been
a major factor in limiting the features offered by this display model.

The following features were thought and will be implemented to enhance the project.

➢ More interactive feature addition.


➢ Hardware interface inclusion.
➢ Using an openGL framework
➢ More realistic and advanced graphics can be implemented.
➢ Frame rate can be increased to look more natural.

Dept.CSE,CEC 2022-2023 Page22


THRISTY CROW

REFERENCES

1. Interactive Computer Graphics A Top-Down Approach with OpenGL - EdwardAngel, 5th


2. Edition, Addison-Wesley, 2008
3. The Official Guide to Learning OpenGL, by Jackie Neider, Tom Davis, Mason Woo (THE REDBOOK)
4. Jechoutek, Karl, Rural Energy and Development- An Action Plan, World Bank Renewable Energy
Roundtable, March 25, 1997.
5. OpenGL Super Bible by Richard S. Wright, Jr. and MichaelSweet5.
http://www.cs.rutgers.edu/~decarlo/428/glman.html online man pages.
6. OpenGL tutorials
http://www.nptel.com
7. GOOGLE
http://www.google.ac.in

Dept.CSE,CEC 2022-2023 Page23


DECLARATION

We students of 6th semester BE, Computer Science and Engineering College hereby declare
that project work entitled “Thirsty crow” has been carried outby us at City Engineering
College, Bengaluru and submitted in partial fulfilment of the course requirement for the award
of the degree of Bachelor of Engineering in Computer Science and Engineering of
Visvesvaraya Technological University, Belgaum, during the academic year 2022-2023.

We also declare that, to the best of our knowledge and belief, the work reported here does not
from the part of dissertation on the basis of which a degree or award was conferred on an earlier
occasion on this by any other student.

Date:
Place: Bangalore

KEERTHANA L V MANOJ KUMAR


(1CE20CS043) (1CE20CS083)

You might also like