A Man in The Rain Animation: in Computer Science and Engineering

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

A Project Report

on

A man in the Rain Animation


carried out as part of the course
Computer Graphics and Multimedia

Submitted By
SAI SANTOSH MALLADI
179303126
VI-CSE

Towards the partial fulfillment for the Award of the Degree of

BACHELOR OF TECHNOLOGY
In Computer Science and Engineering
2017-2021

Department of Computer Science and Engineering


School of Computing and Information Technology
Manipal University Jaipur
Jaipur, Rajasthan
INTRODUCTION

The term computer graphics has been used in a broad sense to describe "almost everything on
computers that is not text or sound". Typically, the term computer graphics refers to several
different things:
 The representation and manipulation of image data by a computer
 The various technologies used to create and manipulate images
 Methods for digitally synthesizing and manipulating visual content, see study of
computer graphics

Computer graphics is branch of computer science that 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. A great deal of
specialized hardware and software has been developed, with the displays of most devices being
driven by computer graphics hardware. It is a vast and recently developed area of computer
science. The phrase was coined in 1960 by computer graphics researchers Verne Hudson and
William Fetter of Boeing. It is often abbreviated as CG, or typically in the context of film
as CGI.

Some topics in computer graphics include user interface design, sprite graphics, rendering, ray


tracing, geometry processing, computer animation, vector graphics, 3D
modeling, shaders, GPU design, implicit surface visualization, image processing, computational
photography, scientific visualization, computational geometry and computer vision, among
others. The overall methodology depends heavily on the underlying sciences
of geometry, optics, physics, and perception.

Computer graphics is responsible for displaying art and image data effectively and meaningfully
to the consumer. It is also used for processing image data received from the physical world.
Computer graphics development has had a significant impact on many types of media and has
revolutionized animation, movies, advertising, video games, and graphic design in general.
METHEDOLOGY

In computer graphics, we use graphics.h which provide facility of direct functions to draw
different 2D geometric shapes such as point, line, triangle, quadrilaterals, circle, ellipse and
many more such shapes. By help of these functions we can draw different objects like car, hut,
trees etc.

Pre-defined Functions from grahics.h library used in program are as follows:


1. Arc():
The header file graphics.h contains arc() function which draws an arc with center at (x, y) and
given radius. start_angle is the starting point of angle and end_angle is the ending point of the
angle. The value of the angle can vary from 0 to 360 degree.

2. Circle():
The header file graphics.h contains circle() function which draws a circle with center at (x, y)
and given radius.

3. Line():
A function from graphics.h header file which draw a line with (x1, y1) as first coordinate of line
and (x2, y2) as second coordinate of the line.

4. Piesclice(): pieslice() draws and fills a pie slice with center at (x, y) and given radius r. The
slice travels from s_angle to e_angle which are starting and ending angles for the pie slice.
The angles for pie-slice are given in degrees and are measured counterclockwise.
User defined functions in the program :
1. void displayMan() : This function is used to create and display the man on screen .
various shapes from the graphics.h library are used to create this.
2. void drawCloud() : This function is used to draw and create the cloud on the screen.

Tools :
1. Turbo C++ to compile and run the code with graphics.h library

Implementation

#include<conio.h>
#include<stdio.h>
#include<graphics.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-90); //umbrella
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,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=1;
int rx,ry;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
while(!kbhit())
{
cleardevice();
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);
}

//legs
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();
}

Output :
Future Work and Conclusion
Future Work:
1. Option to change the direction of wind speed and rain.
2. Option to change objects to view in rain.
Conclusion :
This project was to understand the basic functionalities of graphics.h library and it’s commonly
used functions and tries to apply the concepts of the course Computer Graphics and Multimedia.
This project was also to understand the basics of graphics which would be beneficial for much
further advanced application and using of different software for designing and animation

References:
1. https://developerinsider.co/graphics-graphics-h-c-programming/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy