You are on page 1of 32

A MAN WALKING IN THE RAIN

PBL REPORT

(17CSC12-GRAPHICS AND MULTIMEDIA)

Submitted by

V.MOHANASUNDRARAJ (17CS60)

R.PAVITHRA (17CS073)

S.SABARINATH (17CS085)

K.SALMA (17CS086)

in partial fulfillment for the award of the degree of

BACHELOR OF ENGINEERING IN

COMPUTER SCIENCE AND ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE

AND ENGINEERING

NANDHA ENGINEERING COLLEGE

ERODE-638052

(Autonomous)

(Affiliated to Anna University, Chennai)

OCTOBER-2019
A MAN WALKING IN THE RAIN

PBL REPORT

(17CSC12-GRAPHICS AND MULTIMEDIA)

Submitted by

V.MOHANASUNDRARAJ (17CS60)

R.PAVITHRA (17CS073)

S.SABARINATH (17CS085)

K.SALMA (17CS086)

in partial fulfillment for the award of the degree of

BACHELOR OF ENGINEERING IN

COMPUTER SCIENCE AND ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE

AND ENGINEERING

NANDHA ENGINEERING COLLEGE

ERODE-638052

(Autonomous)

(Affiliated to Anna University, Chennai)

OCTOBER-2019

I
NANDHA ENGINEERING COLLEGE
(Autonomous)
(Affiliated to Anna University, Chennai)

BONAFIDE CERTIFICATE

Certified that this Report titled “A MAN WALKING IN THE RAIN” is


the bonafide work of V.MOHANASUNDARARAJ (17CS060), R.PAVITHRA
(17CS073), S.SABARINATH (17CS085), and K.SALMA (17CS086) who
carried out the work under my supervision.

Signature of the HOD Signature of the Supervisor

Mr. K. GUNASEKAR M.E... Mrs. NAVAMANI


Associate Professor & Head Assistant professor
Department of CSE Department of CSE
Nandha Engineering College Nandha Engineering College
Erode 638052 Erode 638052

Submitted for End Semester PBL Review Examination held on …………………...

EXAMINER

II
TABLE OF CONTENTS

CHAPTER NO TITLE PAGE NO


1 Introduction 1
2 Objectives 2
3 Theoretical Backgrounds 3
4 Features and Scopes 5
5 Existing System 7
6 Proposed System 8
7 Methodology 10
8 A Man walking in the Rain Steps 16
9 Source Code 22
10 Conclusion 25
11 References 26

III
ABSTRACT
This report has been prepared to the “Graphically A Man Walking in the
Rain”. This document is the final report of the findings and recommendations of
the Computer Graphics for III year I part. Computer graphics remains one of the
most exciting and rapidly growing computer fields. Computer graphics has now
become a common element in user interfaces, data visualization, television
commercial, motion pictures, and many-many other application. With the
advantages of Graphics, modern subject, we can be able to design different
applications and tools which can be beneficial in our daily life. Besides, some
entertaining applications can also be designed using Graphics such as Games,
Photo Effects etc. Many people have contributed to this project in variety of ways.
To all of them we would like to express our appreciation. We are trying to apply
the Graphics applications on designing a Man Walking in the Rain. It will display
give the Rain, clouds, man and an Umbrella.

IV
CHAPTER 1
INTRODUCTION
Computer has become a powerful tool for the rapid and economical
production of pictures. Computer Graphics remains one the most exciting and
rapidly growing fields. Old Chinese saying “One picture is worth of thousand
words” can be modified in this computer era into “One picture is worth of many
kilobytes of data”. It is natural to expect that graphical communication will often
be more convenient when computers are utilized for this purpose. Many people for
different domain of applications use interactive graphics. For example structural
engineering use for efficient design of structures on the basis of the analysis of
stress in various elements of the structure. From the survey it is evident that in
future, engineers, designers etc. will be using computer graphics quite extensively.
There is virtually no area in which graphical displays cannot be used to some
advantage, and so it is not surprising to find the use of computer graphics so
widespread. Today, we find Computer Graphics used routinely in such diverse
areas such as science, engineering, medicine, business, industry, government, art,
entertainment, advertising, education, training, etc. So for understanding the depth
of this subject and for gaining sound knowledge in this field we had an attempted
to the first step on this current field. We tried to make a graphically designated A
Man Walking in the Rain. The Graphic Designated Man, Cloud, Rain and
Umbrella are made with the application of Graphics codes. This project applied the
subject and made the graphics with the image and video editing. We hoped with
our project the illiterate (who cannot read the letters) can be benefitted in day to
day life.

1
CHAPTER 2

OBJECTIVES

The main objectives of this project are:

 To implement the features of graphics.


 To interface the applications of graphics to the real world.
 To give some benefits to the disability.
 To make the life easier.
 To become familiarization with Graphics and its logical coding.

2
CHAPTER 3

THEORITICAL BACKGROUND

PRINCIPLES AND VERSIONS

The primary goals in the creation of a man walking in the rain are:

 It must be “Simpler and familiar”.


 It must be “able convey the exact information”.
 It must be “attractive”.
 It should contain “Multimedia Components”.
As per 2019 these were the versions released by the developers:
 1.10.87
 1.21.0
 1.32.0
 1.43.0
 1.54.0
 1.65.0
 1.76.0
 1.87.0
 1.9CS(8.0)
 1.10CS2(9.0)
 1.11CS3(10.0)
 1.12CS4(11.0)
 1.13CS5(12.0)
 1.14CS6,CS6 Extended (13.0)
3
 1.16CC (14.1)
 1.17CC (14.2)
 1.17CC (14.2)
 1.18CC 2014 (15.0 or 20140508.r.58)
 1.19CC 2.14.2.2 (15.2.2 or 20141204.r.310)
 1.20CC 2015 (16.0 or 20150529.r.88)
 1.21CC 2015.1 (16.1 or 20151114.r.301)
 1.22CC 2015.5 (17.0 or 20160603.r.88)
 1.23CC 2015.5.1 (17.0.1 or 20160722.r.156)
 1.24CC 2017 (18.0 or 20161012.r.53)
 1.25CC 2017.0.1 (18.0.1 or 20161130.r.29)
 1.26CC 2017.1.0 (18.1.0 or 20170300.r.207)
 1.27CC 2017.1.1 (18.1.1 or 20170425.r.252)
 1.28CC 2018 (19.0.0)
 1.29CC 2018 (19.0.1)
 1.30CC 2018 (19.1)
 1.31CC 2018 (19.1.1)
 1.32CC 2018 (19.1.2)
 1.33CC 2018 (19.1.3)
 1.34CC 2018 (19.1.4)
 1.35CC 2018 (19.1.5)
 1.36CC 2018 (19.1.6)
4

CHAPTER 4

FEATURES AND SCOPES

Computer Graphics has revolutionized almost every computer-based


application in science and technology. Information technology is a trend today. As
the volume of information increases, problem of storage arises. As time is money,
in the 21st century people doesn’t have the time to read huge number of pages. So
this problem is solved by Computer Graphics. Picture can represent a huge
database like bar charts, pie charts etc. suppose, we have to show the performance
of some factory related with profit since 1980. One requires large number of pages
to store this huge information related with financial, numerical and statistical
information. A common man requires a lot of time to understand it. There is an
alternative to show or represent this information with the help of graphical tools
such as bar chart or pie chart i.e. we can express this data in pictorial forms.

The importance of computer graphics lies in its applications. In engineering


applications (e.g. automotive and aerospace) the ability to quickly visualize newly
designed shapes is indispensible. Computer graphics has also expanded the
boundaries of art and entertainment. Movies such as “JURASSIC PARK” make
extensive use of computer graphics to create images that test the bounds of
imagination. The development of computer graphics has made possible virtual
reality, a synthetic reality that exists only inside a computer. Virtual reality is fast
becoming an indispensable tool in education. Flight simulators are used to train
pilot for extreme conditions. Surgical simulators are used to train novice surgeons
without endangering patients.
5

Our project is one of the examples for the above mutation features and scope
of computer graphics and its applications. Applications like our projects can be
further improved with more features and can be implemented in our day-to-day
life. We can take many advantages of this subject in the future. It is probable that
at present situation also, it is anyhow utilized in modern technical gadgets.

6
CHAPTER 5

EXISITING SYSTEM
7

CHAPTER 6
PROPOSED SYSTEM
8
9

CHAPTER 7

METHODOLOGY
This project was done with the help of C-Programming Language. Different
methods are performed in order to make it more applied and efficient. C Graphics
programming is very easy and interesting. We used graphics programming for
developing our projects, for designing, animation etc. It's not like traditional C
programming in which you have to apply complex logic in your program and then
you end up with a lot of errors and warnings in your program. In C graphics
programming you have to use standard library functions (need not worry if you
don't know functions) to get your task done. Just you pass arguments to the
functions and it's done. Many graphic functions are coded on its header file
<graphics.h>.

Sample Graphics Code:

This program initializes graphics mode and then closes it after a key is
pressed. To begin with we have declared two variables of int type gd and gm for
graphics driver and graphics mode respectively, you can choose any other variable
name as you wish. DETECT is a macro defined in "graphics.h" header file, then
10

we have passed three arguments to initgraph function first is the address of gd,
second is the address of gm and third is the path where your BGI files are present
(we have adjusted this accordingly where our turbo compiler is installed). Initgraph
function automatically decides an appropriate graphics driver and mode such that
maximum screen resolution is set, getch () helps us to wait until a key is pressed,
closegraph () function closes the graphics mode and finally return statement returns
a value 0 to main indicating successful execution of your program.

Some of the function included in<graphics.h> used in our project:

i) Line function:

line function is used to draw a line from a point(x1,y1) to


point(x2,y2) i.e.(x1,y1) and(x2,y2) are end points of the line. The
code given below draws a line.

Declaration: - void line (int x1, int y1, int x2, int y2);

ii) Circle function:

Circle function is used to draw a circle with center (x, y) and


third parameter specifies the radius of the circle. The code given
below draws a circle.

Declaration: - void circle (int x, int y, int radius);

iii) Setcolor function:

In Turbo Graphics each color is assigned a number. Total 16


colors are available. Strictly speaking number of available colors
11
depends on current graphics mode and driver. For Example :- BLACK
is assigned 0, RED is assigned 4 etc. setcolor function is used to
change the current drawing color.e.g. Setcolor (RED) or setcolor(4)
changes the current drawing color to RED. Remember that default
drawing color is WHITE.

Declaration: - void setcolor (int color);

iv) Outtextxy function:

Outtextxy function display text or string at a specified point(x,


y) on the screen.

Declaration: - void Outtextxy (int x, int y, char *string);


x, y are coordinates of the point and third argument contains the
address of string to be displayed.

v) Getmaxx function:

getmaxx function returns the maximum X coordinate for


current graphics mode and driver.

Declaration:-int getmaxx ();

vi) Getmaxy function:

getmaxy function returns the maximum Y coordinate for


current graphics mode and driver.
Declaration:- intgetmaxy();
12

vii)

viii) Setlinestyle function:

Setlinestyle function sets line style, thickness, unsigned upattern etc.

Declaration: - void setlinestyle (intlinestyle, unsigned upattern, int


thickness);

ix) Putpixel function:

putpixel function plots a pixel at location (x, y) of specified color.

Declaration: - void putpixel (int x, int y, int color);


For example if we want to draw a GREEN color pixel at (35, 45) then we
will write putpixel (35, 35, GREEN); in our c program, putpixel function
can be used to draw circles, lines and ellipses using various algorithms.

x) Setfillstyle function:

setfillstyle function sets the current fill pattern and fill color.

Declaration: - void setfillstyle (int pattern, int color);


13

OTHERHEADER FILE USED:

 <stdio.h>:
The C programming language provides many standard
library functions for file input and output. These functions make up
the bulk of the C standard library header <stdio.h>.The I/O
functionality of C is fairly low-level by modern standards; C abstracts
all file operations into operations on streams of bytes, which may be
"input streams" or "output streams". Unlike some earlier programming
languages, C has no direct support for random-access data files; to
read from a record in the middle of a file, the programmer must create
a stream, seek to the middle of the file, and then read bytes in
sequence from the stream.

Stdio.h functions used in our project:

 Sprint
 If/else
 Break
 While
 Struct

 <conio.h>:
conio.h header used in c programming contains functions for
console input/output. Some of the most commonly used functions of
conio.h are clrscr (), getch (), getche (), kbhit () etc. Functions of
14

conio.h can be used to clear screen, change color of text and


background, move text, check if a key is pressed or not and many
more. Conio.h file is provided by Borland turbo c compiler and GCC
compiler doesn't support it.

Conio.h functions used in our project:

 clrscr
 getch
 kbhit

 <math.h>:
Math.h header file (<math.h>) of c programming language
contains constants and functions to perform mathematical operations.
You can use functions of math.h in your c programs to calculating
absolute value of a number, calculating logarithms and using
trigonometric functions to calculate sine, cosine of an angle.

Math.h functions used in our project:

 cos
 Sin
 Pow

<dos.h>:
dos.h header file of c language contains functions for handling
interrupts, producing sound, date and time functions etc. It is borland
specific and works in turbo c compiler.

15

CHAPTER 8

A MAN WALKING IN THE RAIN STEPS

Step 1: Open the Turbo C++

Step 2: Start the Turbo C++.


16

Step 3: Create a new file.


17

Step 4: write the code here.


Step 5: Compile the program.

18
Step 6: Run the Program

19
Step 7: display the output.

Step 8: Exit the Turbo C++.

20
21
CHAPTER 9

SOURCE CODE

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
void displayMan(int x,int y)
{
circle(x,y,10);
line(x,y+10,x,y+30);
line(x,y+30,x-20,y+40);
line(x,y+30,x+20,y+40);
line(x+20,y+40,x+30,y+30);
line(x,y+30,x,y+70);
line(x+30,y+30,x+30,y-90);
pieslice(x+30,y-30,0,180,55);
}
void drawCloud(int z,int y)
{
int r=50;
arc(z,y,45,135,r);
arc(z+50,y,45,135,r);
arc(z+100,y,45,135,r);
arc(z,y,135,225,r);
arc(z+50,y,135+90,225+90,r);
arc(z,y,135+90,225+90,r);
arc(z+100,y,315,45,r);
}
void main()
{
int gd=DETECT,gm,i,d=0,x=50,y=340,z=50,shouldmove=0;
int rx,ry;
initgraph(&gd,&gm,"c:\\TURBOC3\\bgi");
while(!kbhit())
{
cleardevice();

22
displayMan(x,340);
drawCloud(z,60);
line(0,430,639,430);
for(i=0;i<500;i++)
{
rx=rand()%639;
ry=rand()%439;
if(rx>=(x-40)&&rx<=(x+110))
if(ry>=(y-50)&&ry<=479)
continue;
line(rx-10,ry+10,rx,ry);
}
if(shouldmove)
{
if(d<20)
d+=4;
else
shouldmove=0;
line(x,y+70,x-d,y+90);
line(x,y+70,x+d,y+90);
}
else
{
if(d>0)
d-=4;
else
shouldmove=1;
line(x,y+70,x-d,y+90);
line(x,y+70,x+d,y+90);
}
delay(200);
x=(x+10)%639;
}
getch();
}

23
OUTPUT:-

24
CHAPTER 10
CONCLUSION

This project is one of the sample project on Computer Graphics.. Though


many difficulties were faced during the project as well as many errors occurred, we
became succeed to compile and run the program. There may be some limitations
on this project as well, so, in the near future we would like to be hopeful in further
improvements. We are highly obliged to all helping hands and to all inspirations to
make this project successful. Well this project will be applicable to most of all. As
well as, we are more hopeful for more advice, new ideas and inspiration to make
more other projects.

To had tried our best to include each and every basic features of graphics in
our projects. We aimed it to be an interfacing application to the real world that
means our project must not be a project for any examination but also applicable for
real world use. We have able to give some benefits to the disability. It somehow
makes our life easier in this or that way. From this very project we were able to
achieve various knowledge in computer graphics and also in logical coding. We
refresh our knowledge in C Programming. Moreover we also gained an experience
of group work, team coordination. We learned how team work is very much
important in engineering field.

25
CHAPTER 11

REFERENCES

 Donald, Hearn. Computer Graphics. Pearson Education: 2005, Pearson

Education.

 www.learnstreet.com

 http://www.sourcecodesworld.com/

26

You might also like