Professional Documents
Culture Documents
Rain Animation”
“
- Submitted To-
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.
Seal
Of
Institution
2
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Certificate
Seal
Of
Institution
3
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Certificate
Seal
Of
Institution
4
MIT Polytechnic Pune Rain Animation
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Cerificate
Seal
Of
Institution
5
MIT Polytechnic Pune Rain Animation
STUDENT GROUP DETAILS[ IF GROUP IS APPLICABLE ]:
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
8
MIT Polytechnic Pune Rain Animation
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
Analysis
4 Finalizing Layout 07/12/2022 7/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);
}
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