You are on page 1of 21

MIT Polytechnic Pune Rain Animation

MAHARASHTRA STATE BOARD OF TECHNICAL


EDUCATION
MAEER’s MIT POLYTECHNIQUE
PUNE
MICROPROJECT
Academic Year: 2022-23

Department of Computer Engineering

Rain Animation”

- Submitted To-

MAHARASHRA STATE BOARD OF


TECHNICAL EDUCATION
MUMBAI

Program : Computer Engineering


Program code : CO3I
Course : Computer Graphics

Course code : 22318

1
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

Certificate

This is to certify that Nakul Anil Patil Roll no.74. In 3rd semester
of diploma in Computer engineering of institute: MAEER’s MIT
Polytechnic Pune (code: 0148) has completed the Microproject
satisfactorily in subject Computer Graphics for the academic year 2022-
23 as prescribed in the curriculum.

Place: Kothrud,pune Enrollment No:2101480166


Date :18-12-2022 Exam Seat No:

Prof.J.V.Kachre Prof.J.Khurpade Dr.R.S.Kale


Subject teacher Head of the Department Principal

Seal
Of
Institution

2
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

Certificate

This is to certify that Vishal Tayade Roll no.106. In 3rd semester of


diploma in Computer engineering of institute: MAEER’s MIT Polytechnic
Pune (code: 0148) has completed the Microproject satisfactorily in subject
Computer Graphics for the academic year 2022-23 as prescribed in the
curriculum.

Place: Kothrud,pune Enrollment No:22148019


Date : 18-12-2022 Exam Seat No:

Prof.J.V.Kachre Prof.J.Khurpade Dr.R.S.Kale


Subject teacher Head of the Department Principal

Seal
Of
Institution

3
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

Certificate

This is to certify that Kalpesh Wahurwagh Roll no.81. In 3rd


semester of diploma in Computer engineering of institute: MAEER’s
MIT Polytechnic Pune (code: 0148) has completed the Microproject
satisfactorily in subject Computer Graphics for the academic year 2022-
23 as prescribed in the curriculum.

Place: Kothrud,pune Enrollment No: 2101480173


Date :18-11-2022 Exam Seat No:

Prof.J.V.Kachre Prof.J.Khurpade Dr.R.S.Kale


Subject teacher Head of the Department Principal

Seal
Of
Institution

4
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Cerificate

This is to certify that Roopesh Torane Roll no.80. In 3rd


semester of diploma in Computer engineering of institute: MAEER’s
MIT Polytechnic Pune (code: 0418) has completed the Microproject
satisfactorily in subject Computer Graphics system for the academic
year 2022-23 as prescribed in the curriculum.

Place: Kothrud,pune Enrollment No:2101480172


Date :18-12-2022 Exam Seat No:

Prof.J.V.Kachre Prof.J.Khurpade Dr.R.S.Kale


Subject teacher Head of the Department Principal

Seal
Of
Institution

5
MIT Polytechnic Pune Rain Animation
STUDENT GROUP DETAILS[ IF GROUP IS APPLICABLE ]:

SR. STUDENT ROLL. ENROLLMENT SEAT


NAME NO
NO NO NO
Nakul Anil Patil 74 2101480166
1
Roopesh Torane 80 2101480172
2
3 Kalpesh Wahurwagh 81 2101480173

Vishal Tayade 106 2201480019


4

Name of Guide: Prof.J.V.Kachre

6
MIT Polytechnic Pune Rain Animation

INDEX
SR. PAGE.
NO CONTENT NO
1 ACKNOLEDGE 8
2 Requirement 9
3 Action Plan 10
4 Program 11
5 Output 13
6
7
8

7
MIT Polytechnic Pune Rain Animation
ACKNOWLEDGE

We have great pleasure and sense of satisfaction in


this micro-project report on “Rain Animation” aspart of the
curriculum of Diploma in Computer Engineering. Being novice
in the field of designing and structuring in this micro-project, it
could have been extremely difficult for us to complete this
micro project on our own. We are very fortunate to be guided
by people with vast and resourceful experience in their
respective field of work
We express my sincere gratitude to our guide Prof.J.V.Kachre
for her timely guidance, support and suggestions. Weare
also thankful for her sincere help and for making us
available all the facilities of the department. Without her
efforts and constant monitoring the micro-project and
documentation would not have been duly completed. Also,
we express our sincere
thanks to Prof.M. khurpade(HOD Computer Department),
besides,we take this opportunity to express our sincere
gratitude to the Principal Dr.R.S.Kale for providing a good
environment and facilities to complete this micro-project.
We would also like to thank all my colleagues who have
directly or indirectly guided and helped us in the
preparation of this microproject

8
MIT Polytechnic Pune Rain Animation

Sr. No. Name of Specification Quantity Remarks


Resources/
Material

1. Computer Any desktop/ One computer


system system for each
laptop with student
Linux
distribution
2. Not applicable
Office MS office or
software Libre office
package
3. Virtual Lab Not applicable
Software
required

9
MIT Polytechnic Pune Rain Animation

3.0Action plan

SR. NAME OF
Details of Activity PLAN PLAN RESPONSIBLE TEAM
no SHOR FINISHING MEMBER
T DATE DATE
1 Searching for topic 6/12/2022 6/12/22 Nakul

2 Surviving information 6/12/2022 6/12/22 Kalpesh

3 Requirement 7/12/022 7/12/22 Vishal

Analysis
4 Finalizing Layout 07/12/2022 7/12/22 Nakul

5 Generating 12/12/2022 12/12/22 Nakul

Program and
Final Execution
6 Report generation 2012/2022 20/12/22 Roopesh
Nakul
7 Final submission 20/12/022 20/12/22

10
MIT Polytechnic Pune Rain Animation

Introduction-
Computer graphics deals with generating images with
the aid of computers. Today, computer graphics is a
core technology in digital photography, film, video
games, cell phone and computer displays, and many
specialized applications.
Using C++ we created “Rain Animation”.
1. Firstly, using circle() and line() function we created
face, neck, Hand, Umbrella etc.
2. Then to create grass and cloud we used user
defined function drawcloud(), drawgrass().
3. To fill colors in the animation we used certain
functions such as setcolor(), setfillstyle() and
floodfill().
4. Using conditions such as if & else and using
function such as delay we created a man holding
umbrella and walking in rain. And clouds and grass
are present in the scenario.

11
MIT Polytechnic Pune Rain Animation

Program:
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
#include<stdlib.h>
void displayMan(int x,int y)
{
circle(x,y,10); //face
line(x,y+10,x,y+30); //neck
line(x,y+30,x-20,y+40); //left hand
line(x,y+30,x+20,y+40); //right hand
line(x+20,y+40,x+30,y+30);
line(x,y+30,x,y+70); //body
line(x+30,y+30,x+30,y-50); //umbrella
//pieslice(x+30,y-30,0,180,55);
}

void drawCloud(int z,int y)

12
MIT Polytechnic Pune Rain Animation

{
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,135+90,225+90,r);
arc(z+100,y,315,45,r);
}

void drawGrass()
{
setcolor(LIGHTGREEN);
arc(75,450,30,110,10);
setcolor(LIGHTGREEN);
arc(95,450,90,160,10);
setcolor(LIGHTGREEN);
arc(74,450,45,115,14);

13
MIT Polytechnic Pune Rain Animation

setcolor(LIGHTGREEN);
arc(95,449,105,160,14);
setcolor(LIGHTGREEN);
arc(221,448,30,110,10);
setcolor(LIGHTGREEN);
arc(241,448,90,160,10);
setcolor(LIGHTGREEN);
arc(220,448,45,115,14);
setcolor(LIGHTGREEN);
arc(241,447,105,160,14);
setcolor(LIGHTGREEN);
arc(356,447,30,110,10);
setcolor(LIGHTGREEN);
arc(376,447,90,160,10);
setcolor(LIGHTGREEN);
arc(355,447,45,115,14);
setcolor(LIGHTGREEN);
arc(376,446,105,160,14);
setcolor(LIGHTGREEN);
arc(515,450,30,110,10);

14
MIT Polytechnic Pune Rain Animation

setcolor(LIGHTGREEN);
arc(535,450,90,160,10);
setcolor(LIGHTGREEN);
arc(514,450,45,115,14);
setcolor(LIGHTGREEN);
arc(535,449,105,160,14);

void main()
{
int
gd=DETECT,gm,i,j,d=0,x=50,y=340,z=50,shouldMo
ve=1;
int rx,ry,k,l,xl,xr,a;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
while(!kbhit()) //WHILE KEYBOARD IS NOT
USED,CONTINUE.
{
cleardevice();
setcolor(WHITE);
15
MIT Polytechnic Pune Rain Animation

setfillstyle(SOLID_FILL,RED);
arc(x+30,y-30,0,180,55);
line(x+85,y-30,x-25,y-30);
floodfill(x+40,y-40,WHITE);
displayMan(x,360);
setcolor(BLUE);
drawCloud(z,60);
setcolor(BLUE);
setfillstyle(SOLID_FILL,LIGHTBLUE);

drawCloud(z+200,60);
setcolor(BLUE);
setfillstyle(SOLID_FILL,LIGHTBLUE);

drawCloud(z+400,60);
setcolor(BLUE);
setfillstyle(SOLID_FILL,LIGHTBLUE);

floodfill(z,70,BLUE);
floodfill(z+200,70,BLUE);

16
MIT Polytechnic Pune Rain Animation

floodfill(z+400,70,BLUE);

drawGrass();

setcolor(BROWN);
line(0,450,639,450);
setcolor(GREEN);

// for(l=0;l<=639;l+=20)
for(a=10;a<=639;a+=10)
{
xl=a-10;
xr=a+10;
line(xl,450,a,455);
line(xr,450,a,455);
line(xl+1,455,a,460);
line(xr+1,455,a,460);
line(xl+1,460,a,465);
line(xr+1,460,a,465);
line(xl+1,465,a,470);

17
MIT Polytechnic Pune Rain Animation

line(xr+1,465,a,470);
line(xl+1,470,a,475);
line(xr+1,470,a,475);
line(xl+1,475,a,480);
line(xr+1,475,a,480);
}

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;
setcolor(LIGHTBLUE);
line(rx-10,ry+10,rx,ry);
}

//legs
if(shouldMove)

18
MIT Polytechnic Pune Rain Animation

{
if(d<20)
d+=4;
else
shouldMove=0;
setcolor(WHITE);
line(x,y+90,x-d,y+110);
line(x,y+90,x+d,y+110);
}
else
{
if(d>0)
d-=4;
else
shouldMove=1;
setcolor(WHITE);
line(x,y+90,x-d,y+110);
line(x,y+90,x+d,y+110);
}
delay(200);

19
MIT Polytechnic Pune Rain Animation

x=(x+10)%639;

}
getch();
}

Conclusion:
If else statements, delay(), line() are used to give
moment to the animation. Attributes are very
sensitive they make all the difference in the shape of
animation.

Reference:
1. github.com
2. W3school.com
3. geekforgeeks.com
20
MIT Polytechnic Pune Rain Animation

Output:

21

You might also like