CG Final Report
CG Final Report
“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)
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.
External Viva
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
ACKNOWLEDGEMENT
ABSTRACT
1. INTRODUCTION…………………………………………… 1
2. LITERATURE SURVEY……………………………………..9
5. IMPLEMENTATION ...............................................................13
6. SNAPSHOTS…………………………………………….........15
APPENDIX……………………………………………..…......19
REFERENCES…………………………….…………...…….. 23
LIST OF FIGUREES
..
THRISTY CROW
CHAPTER 1
INTRODUCTION
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
the general-purpose computer system. There are five major elements in system: input devices, processor,
memory, frame buffer and output devices
• 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.
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:
• 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:
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
GLU
OpenGL GL
Application Frame
Xlib,Xtk
GLX
➢ These games require human interaction with the User Interface for making nice visual result on the
Video Device
➢ 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.
➢ 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)
➢ 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
➢ 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
➢ Computational Physics
➢ Information Visualization
➢ Display of Information
➢ Information Architecture
➢ Genetics, Molecular Biology, Neuroscience, Animation, Statistics
➢ Desktop Publishing.
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.
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
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.
➢ 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.
CHAPTER 3
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
CHAPTER 4
4.1System Analysis
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();
CHAPTER 5
IMPLEMENTATION
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.
This function handles the animation and the redrawing of the graphics window contents.
void init(void)
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)
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.
CHAPTER 6
SNAPSHOTS
Fig 6.1: Shows the front page of the mini project which gives the description
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.
Fig 6.7: shows thirsty crow put the stone repeatedly to level up the water
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.
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);
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();
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();
}
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.
REFERENCES
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