Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Computer Graphics - Mini Project Report

Man sailing in a boat in the rain animation


Name:
Ishaan Vadhan

Guide name:
Mrs. Prajakta A. Puranik

Project name:
Man sailing in a boat in the rain

Technology/Platform/Language:
Dev-cpp, C++, OOP Concepts, Gaming, Animation.

Problem statement:
Write a C++ program to animate a man sailing in a boat in the rain.

Theory:
a) Animation:
Animation refers to the movement on the screen of the display device created by displaying a
sequence of still images. Animation is the technique of designing, drawing, making layouts and
preparation of photographic series which are integrated into the multimedia and gaming products.
Animation connects the exploitation and management of still images to generate the illusion of
movement. A person who creates animations is called animator. He/she use various computer
technologies to capture the pictures and then to animate these in the desired sequence. Animation
includes all the visual changes on the screen of display devices.

b) Application areas of animation:


 Education and Training:
Animation is used in school, colleges and training centres for education purpose. Flight
simulators for aircraft are also animation based.
 Entertainment:
Animation methods are now commonly used in making motion pictures, music videos and
television shows, etc.
 Computer Aided Design (CAD):
One of the best applications of computer animation is Computer Aided Design and is generally
referred to as CAD. One of the earlier applications of CAD was automobile designing. But now
almost all types of designing are done by using CAD application, and without animation, all
these works can't be possible.
 Advertising:
This is one of the significant applications of computer animation. The most important advantage
of an animated advertisement is that it takes very less space and capture people attention.
 Presentation:
Animated Presentation is the most effective way to represent an idea. It is used to describe
financial, statistical, mathematical, scientific & economic data.
c) Different types of animation styles and techniques:
 Frame by Frame (Traditional Method):
Earlier, in traditional method, animation was done by hands because of the absence of the
computer-aided drawing facilities. And, this traditional method required a lot of effort for even
making a short video because of the fact that every second of animation requires 24 frames to
process.
 Procedural:
In Procedural method, set of rules are used to animate the objects. Animator defines or specify
the initial rules and procedure to process and later runs simulations. Many of the times rules or
procedure are based on real world’s physical rule which are shown by mathematical equations.
 Behavioural:
According to this method/technique, to a certain extent the character or object
specifies/determines its own actions which helps / allows the character to improve later, and in
turn, it frees the animator in determining each and every detail of the character’s motion.
 Key Framing:
A key frame in computer animation is a frame where we define changes in an animation.
According to key framing, a storyboard requirement is must as the animator/artist draws the
major frames (frames in which major/important changes can be made later) of animation from
it. In key framing, characters or object’s key position are the must and need to be defined by
the animator, because the missing frames are filled in those key position via computer
automatically.
 Motion Capture:
This method of animation uses the live action/motion footage of a living human character
which is recorded to the computer via video cameras and markers and later, that action or
motion is used/applied to animate the character which gives the real feel to the viewers as if
the real human character has been animated. Motion Capture is quite famous among the
animators because of the fact that the human action or motion can be captured with relative
ease.
 Dynamics:
In this method, simulations are used in order to produce a quite different sequence while
maintaining the physical reality. Physics’ laws are used in simulations to create the motion of
pictures/characters. High level of interactivity can be achieved in this method, via the use of
real-time simulations, where a real person performs the action or motions of a simulated
character.

d) Types of animation systems:


 Scripting:
Systems Scripting Systems were the earliest type of motion control systems. The animator
writes a script in the animation language. Thus, the user must learn this language and the
system is not interactive. One scripting system is ASAS (Actor Script Animation Language), which
has a syntax similar to LISP. ASAS introduced the concept of an actor, i.e., a complex object
which has its own animation rules. For example, in animating a bicycle, the wheels will rotate in
their own coordinate system and the animator doesn't have to worry about this detail. Actors
can communicate with other actors be sending messages and so can synchronize their
movements. This is similar to the behaviour of objects in object-oriented languages.
 Procedural Animation:
Procedures are used that define movement over time. These might be procedures that use the
laws of physics (Physically - based modelling) or animator generated methods. An example is a
motion that is the result of some other action (this is called a "secondary action"), for example
throwing a ball which hits another object and causes the second object to move.
 Representational Animation:
This technique allows an object to change its shape during the animation. There are three
subcategories to this. The first is the animation of articulated objects, i.e., complex objects
composed of connected rigid segments. The second is soft object animation used for deforming
and animating the deformation of objects, e.g., skin over a body or facial muscles. The third is
morphing which is the changing of one shape into another quite different shape. This can be
done in two or three dimensions.
 Stochastic Animation:
This uses stochastic processes to control groups of objects, such as in particle systems.
Examples are fireworks, fire, water falls, etc.
 Behavioural Animation:
Objects or "actors" are given rules about how they react to their environment. Examples are
schools of fish or flocks of birds where each individual behaves according to a set of rules
defined by the animator.

Algorithm:
 Step 1: Initialize the graphics system.
 Step 2: Using for loop make the line visible and invisible with changing x coordinate to show
that the line is moving forward, do this for the body of the man, the boat and the waves as well.
 Step 3: Using DDA algorithm draw the rain in the background.
 Step 4: After the man reaches the endpoint using for loop, stop the execution of the code.

Code:
#include<iostream>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
using namespace std;
class boatman
{
int rhx,rhy;
public:
void draw(int,int);
void draw(int);
void waves(int);
};
void boatman::draw(int i)
{
waves(i);
if(i%2)
{
setcolor(GREEN);
line(35+i,310,25+i,330);
line(35+i,310,50+i,330);
delay(20);
}
else
{
setcolor(GREEN);
line(35+i,310,40+i,330);
delay(20);
}
setcolor(GREEN);
line(35+i,340,35+i,310);
circle(35+i,300,10);
setcolor(RED);
line(-12+i,340,88+i,340);
arc(38+i,330,192,348,50);
}
void boatman::waves(int i)
{
setcolor(BLUE);
if(i%2)
{
for(int j=0;j<650;j+=20)
arc(j,370,192,348,10);
}
else
{
for(int j=0;j<650;j+=20)
arc(j+10,370,192,348,10);
}
}
void boatman::draw(int x,int y)
{
int j;
rhx=x;
rhy=y;
for
(j=0;j<100;j++)
{
setcolor(CYAN);
outtextxy(rand()%rhx,rand()%(rhy-50),"*");
setcolor(WHITE);
}
}
int main()
{
int gd=DETECT,gm;
int rhx,rhy,j,i;
boatman obj;
initgraph(&gd,&gm,"");
for(i=0;i<500;i+=5)
{
obj.draw(i);
delay(10);
rhx=getmaxx();
rhy=getmaxy();
obj.draw(rhx,rhy);
delay(100);
cleardevice();
}
getch();
}
Output Screenshot:

Video Links:
Google Drive: https://drive.google.com/file/d/1RNUmEKKwPzo0kybvwaIetHNux4Djw4-
9/view?usp=sharing
Youtube: https://youtu.be/Oggcevjnm5k

You might also like