A Man Walking in The Rain
A Man Walking in The Rain
A Man Walking in The Rain
PBL REPORT
Submitted by
V.MOHANASUNDRARAJ (17CS60)
R.PAVITHRA (17CS073)
S.SABARINATH (17CS085)
K.SALMA (17CS086)
BACHELOR OF ENGINEERING IN
AND ENGINEERING
ERODE-638052
(Autonomous)
OCTOBER-2019
A MAN WALKING IN THE RAIN
PBL REPORT
Submitted by
V.MOHANASUNDRARAJ (17CS60)
R.PAVITHRA (17CS073)
S.SABARINATH (17CS085)
K.SALMA (17CS086)
BACHELOR OF ENGINEERING IN
AND ENGINEERING
ERODE-638052
(Autonomous)
OCTOBER-2019
I
NANDHA ENGINEERING COLLEGE
(Autonomous)
(Affiliated to Anna University, Chennai)
BONAFIDE CERTIFICATE
EXAMINER
II
TABLE OF CONTENTS
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
2
CHAPTER 3
THEORITICAL BACKGROUND
The primary goals in the creation of a man walking in the rain are:
4
CHAPTER 4
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>.
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.
i) Line function:
Declaration: - void line (int x1, int y1, int x2, int y2);
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.
v) Getmaxx function:
12
vii)
x) Setfillstyle function:
setfillstyle function sets the current fill pattern and fill 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.
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.
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.
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
16
Step 3: Create a new file.
17
Step 4: write the code here.
18
Step 6: Run the Program
19
Step 7: display the output.
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
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
Education.
www.learnstreet.com
http://www.sourcecodesworld.com/
26