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

A

MICRO
MICRO-PROJECT
OF
COMPUTER GRAPHICS
“BOUNCING BALL”
Submitted In III- semester for Partial Fulfilment of Requirement for the
Diploma In Computer Engineering Of Maharashtra State Board Of Technical
Education

Submitted By
DURVA YERUNKAR (GROUP LEADER)

Name of Group Members


1. FATIMA MULLA (6203) 2. DURVA YERUNKAR (6206)

2. SAKSHI MORE (6214)

Guided By
Pournima Kamble.
(Lecturer in Computer Dept )

DEPARTMENT OF COMPUTER ENGINEERING


Bharati Vidyapeeth Institute of Technology
2020-2021
SUBMITTED BY:

Roll no. Name of the Student Class

6203 FATIMA MULLA CM3I

6206 DURVA YERUNAKAR CM3I

6214 SAKSHI MORE CM3I


INDEX:

Sr.No. Title

1 Introduction.

2 Uses to make the Code.


(Header files and Functions)

Program code
3

Output
4
INTRODUCTION

Computer graphics are pictures and films created using computers.


Usually, the term refers to computer-generated image data created
with the help of specialized graphical hardware and software. 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, though
sometimes erroneously referred to as computer-generated imagery
(CGI).Some topics in computer graphics include user interface
design, graphics, vector graphics, 3D modelling, shaders and among
others.
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.
USES
Header Files:
1] #include<conio.h> (Console input-output header)
Perform console input and console output operations like clrscr() to
clear the screen and getch() to get the character from the keyboard.

2] #include<stdio.h> (Standard input-output header)


Used to perform input and output operations in C like scanf() and
printf().

3] #include<Graphics.h>
graphics.h functions can be used to draw different shapes, display text
in different fonts, change colors and many more. Using functions of
graphics.h in Turbo C compiler you can make graphics programs,
animations, projects, and games.
Other Functions
1. initgraph(): It is used to initialize graphic mode.
Syntax: initgraph(int driver, int mode, char path);
2. closegraph():The header file graphics.h contains closegraph()
function which closes the graphics mode, deallocates all memory
allocated by graphics system and restores the screen to the mode it
was in before you called initgraph.
Syntax:closegraph();
3. line():This command draws a line on screen.
Syntax:line(x1,y1,x2,y2);
4. circle():This command draws a circle on screen.
Syntax:circle(x,y,r);
C PROGRAM CODE FOR BOUNCING BALL

#include <stdio.h>
#include <conio.h>
#include <graphics.h>

void main()
{
int gd, gm, i, x;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C:\\TC\\BGI");
x = 0;
for( i = 0; i<= 300 ; i++)
{
line(0,310,600,310)
circle (i,i,10);
delay(8);
cleardevice();
}
for(i = 300;i>=0;i--)
{
line(0,310,600,310)
x++;
circle(300+x,i,10);
delay(7);
cleardevice();
}
getch();
closegraph();
}
OUTPUT

You might also like