Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (1 vote)
655 views14 pages

Conputer Graphics Project

The document describes a micro-project on bouncing ball submitted by four students - Mr. Kunal Masurkar, Mr. Aryan Shirodkar, Mr. Prasanna Kadrekar, and Mr. Govind Gawade to the Maharashtra State Board of Technical Education in partial fulfillment of the requirements for a diploma in computer engineering under the guidance of Miss. Yoginee Mondkar for the academic year 2021-2022 at Yashwantrao Bhonsale Polytechnic in Sawantwadi, Maharashtra. The project includes an abstract, introduction, resources required, course outcomes, types of computer graphics, applications, advantages, description of the bouncing ball project code, output, and

Uploaded by

YOU NEED TO ALL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
655 views14 pages

Conputer Graphics Project

The document describes a micro-project on bouncing ball submitted by four students - Mr. Kunal Masurkar, Mr. Aryan Shirodkar, Mr. Prasanna Kadrekar, and Mr. Govind Gawade to the Maharashtra State Board of Technical Education in partial fulfillment of the requirements for a diploma in computer engineering under the guidance of Miss. Yoginee Mondkar for the academic year 2021-2022 at Yashwantrao Bhonsale Polytechnic in Sawantwadi, Maharashtra. The project includes an abstract, introduction, resources required, course outcomes, types of computer graphics, applications, advantages, description of the bouncing ball project code, output, and

Uploaded by

YOU NEED TO ALL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

A

Micro-Project
On

Bouncing Ball
Submitted To
MSBTE

In Partial Fulfilment of Requirement of Diploma Of


Computer Engineering
Under I Scheme
Submitted By

Mr. Kunal Masurkar


Mr. Aryan Shirodkar
Mr. Prasanna Kadrekar
Mr. Govind Gawade

Under the Guidance Of

Miss. Yoginee Mondkar

FOR ACADEMIC YEAR 2021-2022

YASHWANTRAO BHAONSALE POLYTECHNIC,

SAWANTWADI.

1
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION

CERTIFICATE

This is to certify that,

Mr. Kunal Vijay Masurkar Roll No.06

Mr. Govind Gurunath Gawade Roll No.12

Mr. Prasanna Prasad Kadrekar Roll No.13

Mr. Aryan Sunil Shirodkar Roll No.17

Of Third semester of diploma in COMPUTER ENGINEERING of institute Yashwantrao


Bhonsale Polytechnic (1742) has completed the Micro Project satisfactorily in subject

Computer Graphics (22318) for the academic year 2021 to 2022 as prescribed in the
curriculum.

Subject Faculty HOD Principal

Seal of

Institution

2
INDEX

Sr. Contains Page


No. No.
1. Abstract 4
2. Introduction 5
3. Resources Require 6
4. Course Outcome Integrated 7
5. Types Of Computer Graphics 7
6. Application 8
7. Advantages Of Computer Graphics 9
8. Our Project 10
9. Code 11
10. Output 12
11. Conclusion 13
12. Reference 14

3
ABSTRACT
Computer Graphics involves technology to access. The Process transforms and presents information
in a visual form. The role of computer graphics insensible. In today life, computer graphics has now
become a common element in user interfaces, T.V. commercial motion pictures.

Computer Graphics is the creation of pictures with the help of a computer. The end product of the
computer graphics is a picture it may be a business graph, drawing, and engineering.

4
INTRODUCTION
Introduction to Computer Graphics

Graphics is defined as any sketch or a drawing or a special network that pictorially represents some
meaningful information. Computer Graphics is used where a set of image needs to be manipulated or
the creation of the image in the form of pixels and is drawn on the computer. Computer Graphics can
be used in digital photography, film,entertainment, electronic gadgets and all other core technologies
which are required. It is a vast subject and area in the field of computer science. Computer Graphics
can be used in UI design, rendering, geometric object, animation and many more.In most area,
computer graphics is an abbreviation of CG. There are several tools used for implementation of
Computer Graphics. The basic is the <graphics.h> header file in Turbo-C, Unity for advanced and
even OpenGL can be used for it’s Implementation. It was invented in 1960 by great researchers Verne
Hudson and William Fetter from Boeing.

5
Resources Require

S. No. Name of Resource / Material Specification Quantity

Computer(AMD Ryzen
5 5th gen 5600H),
1 Hardware: Computer System 1
RAM 8GB,
Storage: SSD 512GB

2 Operating System Windows 10 1

3 Software Turbo C 1

6
Course Outcomes Integrated
a) Create and utilize bouncing-ball program.

b) Learn various graphics function by applying it into the program.

TYPES OF COMPUTER GRAPHICS


Raster Graphics: In raster graphics pixels are used for an image to be drawn. It is also known as a
bitmap image in which a sequence of image is into smaller pixels. Basically a bitmap indicates a large
number of pixels together.

Vector Graphics: In vector graphics, mathematical formulae are used to draw different types ofshapes,
lines, objects and so on.

7
Applications
Computer Graphics are used for aided design for engineering and architectural system- These are used
in electrical automobile, electro-mechanical, mechanical, electronic devices. For example: gears and
bolts.

Computer Art – MS Paint.

Presentation Graphics – It is used to summarize financial statistical scientific or economic data. For
example- Bar chart, Line chart.

Entertainment- It is used in motion picture, music video, television gaming.

Education and training- It is used to understand operations of complex system. It is also used for
specialized system such for framing for captains, pilots and so on.

Visualization- To study trends and patterns.For example- Analyzing satellite photo of earth.

8
Advantages of Computer Graphics
Now we will be discussing the Advantages of Computer Graphics. Let’s have a look
at the Advantages of Computer Graphics one by one.

• Today, high-quality graphics displays of personal computers provide one of the


most natural means of communicating with a computer.
• It provides tools for producing pictures not only of concrete, “real-world”
objects but also of abstract, synthetic objects, such as mathematical surfaces in
4D and of data that have no inherent geometry, such as survey results.
• It has the ability to show moving pictures, and thus it is possible to produce
animations with interactive graphics.
• With interactive graphics use can also control the animation by adjusting the
speed, the portion of the total scene in view, the geometric relationship of the
objects in the scene to one another, the amount of detail shown, and so on.
• The interactive graphics provides a tool called motion dynamics. With this tool
user can move and tumble objects with respect to a stationary observer, or he
can make objects stationary and the viewer moving around them. A typical
example is walk-throughs made by builders to show flat interior and building
surroundings. In any case, it is also possible to move both objects and viewers.
• The interactive graphics also provides a facility called update dynamics. With
update dynamics, it is possible to change the shape, color, or other properties of
the objects being viewed.
• With the recent development of digital signal processing (DSP) and audio
synthesis chip, interactive graphics can now provide audio feedback along with
graphical feedbacks to make the simulated environment even more realistic.

9
OUR PROJECT
In this program, we will draw a ball move it vertically up and down like a bouncing
ball. We will use below mentioned functions in this program.

initgraph It initializes the graphics system by loading the passed graphics driver then
changing the system into graphics mode.

getmaxx It returns the maximum X coordinate in current graphics mode and driver.

pieslice It 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.

setfillstyle It sets the current fill pattern and fill color.

rectangle It is used to draw a rectangle. Coordinates of left top and right bottom
corner are required to draw the rectangle.

floodfill It is used to fill a closed area with current fill pattern and fill color. It takes
any point inside closed area and color of the boundary as input.

cleardevice It clears the screen, and sets current position to (0, 0).

kbhit It is used to determine whether a key is pressed or not. It returns a non-zero


value if a key is pressed otherwise zero.

delay It is used to suspend execution of a program for a M milliseconds.

closegraph It unloads the graphics drivers and sets the screen back to text mode.

10
Code:
#include<stdio.h>
#include<graphics.h>
#define HEIGHT getmaxy()
#define WIDTH getmaxx()
#define GROUND 450
#define MAXHEIGHT 420

void main()
{

int x,y=0,t=MAXHEIGHT,c=1;
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");

for(x=40;x<=getmaxx();x=x+2)
{
rectangle(0,MAXHEIGHT,getmaxx(),MAXHEIGHT+5);
floodfill(5,MAXHEIGHT+3,WHITE);
pieslice(x,y,0,360,20);
delay(100);

if(y>MAXHEIGHT-20)
{
c=0;
t=t-40;
}

if(y<=(MAXHEIGHT-t))
{
c=1;
}

if(t>=40)
y=y+(c?15:-15);
cleardevice();
if(kbhit())
break;
}

getch();
}

11
OUTPUT:
Starting Point

End Point

12
Conclusion:
This Bouncing Ball Game Project in C teaches you how to create a simple bouncing ball
game using computer programs. In the console interface, the ball keeps moving till the screen
ends.It loses its bounce and momentum as it comes to a stop at the end of the screen.It is a
small example of the use of computers graphics using C language.We can take this a step
further too by developing interfaces and basic games.

13
Reference:
1.https://scanftree.com/programs/c/bouncing-ball-using-c-program/

2. https://www.techcrashcourse.com/2015/08/c-program-bouncing-ball-animation-
graphics.html

3. https://codewin.org/c-program-for-bouncing-ball-animation-using-c-graphics/

4. https://gist.github.com/sahasayan/6522f28cf5830d1a3b466f46ff191b33

14

You might also like