0% found this document useful (0 votes)
189 views21 pages

CGR Microproject

This microproject aims to create a moving animation in C using computer graphics. It will display a number of color changing trees with colorful fonts loading. The literature review discusses pixels, graphics, and the basic graphics pipeline. It also outlines key functions used in the C code like initGraphics(), setColor(), putpixel(), rectangle(), circle(), and closegraph(). References include textbooks on computer graphics and MSBTE schemes that provide syntax for the graphics functions. Websites were also reviewed for additional information. The microproject aims to develop skills in 2D and 3D graphics programming.

Uploaded by

Abhijit Kulkarni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views21 pages

CGR Microproject

This microproject aims to create a moving animation in C using computer graphics. It will display a number of color changing trees with colorful fonts loading. The literature review discusses pixels, graphics, and the basic graphics pipeline. It also outlines key functions used in the C code like initGraphics(), setColor(), putpixel(), rectangle(), circle(), and closegraph(). References include textbooks on computer graphics and MSBTE schemes that provide syntax for the graphics functions. Websites were also reviewed for additional information. The microproject aims to develop skills in 2D and 3D graphics programming.

Uploaded by

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

Course Name : CGR(22318) Academic year : 2023-2024

Semester : 3rd
A STUDY ON

NAME OF MICROPROJECT

Micro Project 'REPO RT


Submitted in 2022 by the group of...............................................students

Roll
No Seat No
Sr. Enrollment
Full name of Studen t
No No l!)
Ill
1.
2.
3.

Under the Guidance of Mr. Dinesh sir

m
Three Years Diploma in Engineering& Technologyof
l-.faharashtra State Board of Technical Education, Mumbai (Autonomous)
ISO 9001:2008 (ISO/IEC-27001:2013)

at
1432- G O V E RN?-.ilENT POLYTECHNIC NANDURBAR.
INDEX

Sr
Title Page no.
No.
1 Rationale 04
2 Aims/Benefits of the micro-project 04
3 Course Outcomes Addressed 04
4 Literature Review 05-14
5 Actual Methodology Followed 14
6 Actual Resources Used 15
7 Outputs of the Micro-Project 15-16
8 Skill Developed / learning out of t his Micro-Project 17
9 Applications of this Micro-Project 17

3
Micro-Project Report

Title of Micro-Project: To create a moving animation using computer graphics

1.0 Rationale
• I Have created this micro-project or moving animation to understand the concept of
computer graphics . for this 1' m used main Header File <graphics.h> as per
computer graphics related programs and conditions .

• What is graphics ?
2D graphics come in two flavors - raster and vector. Raster graphics are the most
common and are used for digital photos, Web graphics, icons, and other types
of images.

• Animation means giving life to any object in computer graphics. It has the
power of injecting energy and emotions into the most seemingly inanimate
objects. Comput er -assisted animation and comput er-generated animation are
two categories of computer animation.

2.0 Aims/Benefits of the Micro-project :


• To Create a mov ing animation of N number of color changing tree with colorful
changing fonts with loading animation .
• Benefit Taken from this micro-project is that to understand the concept of making
a animation using different shapes.

3.0 Course Outcomes Addressed

• Manipulate visual and geometric information of images.


• Implement standard algori thms to draw various graphics objects using C program.
• Develop programs for 20 and 30 transformation .
• Use projections to vis ualize objects on view plane .
• Implement various clipp ing algo rithms .
• Deve lop programs to create curves using algorithms .

4
4.0 Literature Review

• PIXEL:
A pixel (short for picture element) is a single point in a picture. On the monitor of
a computer, a pixel is usually a square. Every pixel has a color and all
the pixels together are the picture.

0
I l--l-----r--+--+-+-1i-+ -+--+ ------1 0 1 2 3 4 5 6 7 8 91011
7
2 6

'
1--1-+--+--+-+-I
5
3 4 ,- ,-
s4t-- 3 {3,
7 2
l--l-+--+--+-+-1i-+--i--+--+------1
t---.-- 1
1-- 5)
6 0 I

12-by-8 pixel gri ds, shown \.'Vith row an d colum n numbers.


On the left, rows a-re numbe red from top to bottom,
on the rig ht, they are numherd bottom to top.

• GRAPHICS:
What is graphics ?

Graphics are visual images or designs on some surface, such as a wall, canvas.
screen,.Q..aQfil, or stone to inform, illustrate, or entertain. In contemporary usage, it
include s a pictorial representation of data, as in computer-aided design and
manufacture, in typesetting and the graphic arts, and in educational and
recreational software. Images that are generated by a computer are called
computer graphics.

BELOW FIGURE SHOWS BASIC GRAPHICS PIPELINE :


a b C
r
'
j
2D Object O bject Window
- Clipping

j
Data -T r.asn t ormaotin - Transtormaaon

r e d
r r

Computer
Frama Buffer Scan
'
-
' '
Display Viewport
COflllerston
Translormation
,

5
Examples are photographs, drawings, line
art, graphs, diagrams, typography, numbers, sym bols, geometric designs, maps, enginee
ring drawings, or other images. Graphics often combine text, illustration,
and color. Graphic design may consist of the deliberate selection, creation,
or arrangement of typography alone, as in a brochure, flyer, poster, web site, or book
without any other element. Clarity or effective communication may be the objective,
association with other cultural elements may be sought, or merely, the creation of a
distinctive style .

• Reference Books :

• " COM PUTER GRAPHICS" By Tech-Know ledge Publication MSBTE I


rd
Scheme 3 Sem Computer Engineering : This book provided me the
Syntaxes and Definitions of all the functions which are written in Program
code of my Graphics animaton Project.

• Basic Function Synat xes :

initGraphics()
initGraQhics(width,height}
setColor(color}
put pixel(x co-orinate, y co-ordinate,COLOR);
setbkcolor(COLOR);

-
....
setcolor(COLOR);
rect angle(xl ,,yl,x2,y2);

- line(xl,yl,x2,y2);

--
closegraph();
settextstyle(font, direction size);

- circle(x,y,radius);
cleardevice();

- arc(x, y, starting angle, ending angle, radius);


setfil lstyle(STYLE,COLOR);

-
...
f loodfi ll(x,y,b oundary color);
ellipse(x, y, starting angle, ending angle, xradius, yradius);
getpi xel(x,y);
-

• Website s: htt p s:// www.w3schoo1s.com/ :


W3Schools is an educational websit e for learning web technologies online.W Content
includes tut orials and references relat ing
to HTML, CSS, JavaScript, JSON, PHP, Pyt hon, AngularJS, React . js, , Bootst rap. Sass, No
ws , jOuerv, xouerv. AJA'i., XML, Raspberry Pi, C++, andJ.aya.

6
htt ps:// cgr.blogs pots.gg.h/ : This site has provided me color codes ofTurboc
compiler to apply in ma ny of a nimatio n parts . provided an appearance to
make animation.

• Program code build in Turbo C Compiler for animation :

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
void firstCrown()
{
setfillstyle(SOLID_FlLL,GREEN);
line(300,40, 200,100);
line(300,40,400,100);
ellipse(300,100,180,360,98,30);
floodfill(310,50,WHITE);
}
void secondCrown()
{
setfillstyle(SOLID_FILL,MAGENTA);
line(250,1 25,180,160);
line(350,1 25,420,160);
ellipse(300,160,180,360,120,30);
flood fill(260,130,WH ITE);
}
void thirdCrown0
{
setfillstyle(SOLID_FlLL,GREEN);
line(230,185,150,230);
line(360,185, 440,230);
ellipse(295,230,180,360,145,30);
flood fill(250,190,WH ITE);
}
void trunk()
{
setfillstyle(SOLID_FILL,BROWN);
line(280, 260,280,350);
line(320,260,320,350);
line(280,350,320,350);
flood fill(285,340,WH ITE);

7
}
void main()
{
int gd =DETECT, gm;
11
initgra ph(&gd ,&gm,"C:\ \ TURBOC3\ \ BGl );
int i, n;

11
printf( W");delay(50)
;
11 11
printf( E );delay(50);
11 11
printf( L );delay(50);
11 11
printf( C );delay(50);
11
printf( O");delay(50);
11 11
printf( M );delay(50);
11 11
printf( E );dela y(50);

11
printf( T");delay(50);
11 11
printf( 0 );delay(50);

11
printf( O");delay(50);
11
printf("U );de la y(50);
11
printf("R );de la y(50);
printf("\ n------CMPUTER ");delay(500);
11
printf("DEPARTM ENT ------\ n );de la y(500);
printf("I" );delay(50);
11
printf(" N );de la y(50);
printf("T");delay(50);
printf("H" );delay(50);
printf("I" );delay(50);
printf("S ");de lay (50);
printf("ANIMATION ");delay(500);
printf("l 11);delay(500);
printf("AM ");de la y(500);
11
printf("SHOWING );dela
y(500);
printf("YOU ");delay(500);
11
printf("ABOUT );dela y(500);
11
printf("A );de la y(500);
11
printf("COLOR );dela y(500 );
11
printf("CHANGING );de la
11
y(500); printf("TREE );de la
y(500); printf("\n SO
8
");delay(500); printf("PLEASE
11
);de la y(500);

9
11 11
printf( WATCH );de lay(S00);
11 11
printf ( THIS );delay(S00);
11 11
printf( CAREFULLY );de lay(S00);
cleardevice();
11
printf( \ nEnt er Number of times you want to change the color of t ree:"
11
); sca nf("%d ,&n);

for(i=0;i<n;i++)
{
setcolor(WHITE);
for(i=35;i<555; i++ )
{
line(25+i,170,25+i,200) ;
}
for(i=35;i<555;i++)
{
setcolor(GREEN);
line (25+i,170,25+i,200);
delay(l0);

setcolor(WHITE);
settextstyle(SMALL_FONT,0,16);
11 11
outtextxy(220,220, LOADING )

delay(l0);

settextstyle(SMALL_FONT,HORIZ_DIR,16);
11
outtextxy(390,220, •••
11
)
;
}closegraph();

11 11
initgra p h(&gd,&gm, C:\ \TURBOC3\\ BGl )

firstCro w n();de la y(200);


secondCrown();delay(200);
thirdCrow n();dela y(200);
t run k();de lay(200);

settextstyle(GOTHIC_FONT,HORIZ_DIR, 2);
settextjustify(CENTER_TEXT, CENTER_TEXT);
11
o utt extxy(300,440, Go ve nnne nt Polytechnic College, Gondia");

setfillstyle(SOLID_FILL,RED);
line (300,40,200,100 );

10
line(300,40,400,100);
ellipse(300,100,180,360,98,30);
floodfill(310,50,WHITE);

setcolor(RED);
settextstyle{TRIPLEX_FONT,HORIZ_DIR, 5);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,370,"CREATED BY" );
delay(2000);
graphdefaults();
clea rde vice();

firstCrown() ;delay(200);
seco ndCro w n();de
lay(200);
thirdCrown();delay(200);
trunk();delay(200);

setfillstyle(SOLID_FILL,MAGENTA);
line(250,125,180,160);
line(350,125,420,160);
ellipse(300,160,180,360,120,30);
floodfill(260,130,WHITE);

settextstyle{TRIPLEX_FONT,HORIZ_DIR, 2);
settext justify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,400,"COMPUTER ENGINEERING (CO-31 )");

settext style(GOTHIC_FONT, HORIZ_DIR, 2);


settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,440,"Govennnent Polytechnic College, Gondia " );

setcolor( M AGENTA);
settextstyle(BOLD_FONT,HORIZ_DIR, 2);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,370," VISHALS KESHARW ANI");
delay(2000);
graphdefaults();
clea rde vice();

firstCrown() ;delay(200);
seco ndCro w n();de
11
lay(200);

12
thirdCrown();delay(200);
trunk();delay(200);

setfill style(SOLID _FlLL,BLUE);


line(230,185,150,230);
line(360,185,440,230);
ellipse(295,230,180,360,145,30);
flood fill (250,190,WHITE);

set t ext style {TRIPLEX_FONT, HORIZ_DIR, 2);


settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,400,"LECTURER, COMPUTER ENGINEERING DEPARTM ENT" );

set t ext style(GOTHIC_FONT, HORIZ_DIR, 2);


settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,440,"Govenm,ent Polytechnic College, Gondia" );

setcolor(GREEN);
sett ext style(SANS _SERIF_FONT, HORIZ_DIR, 3);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,370,"UNDER GUIDANCE OF: KHIRADE SIR [KINGRAJ SIR] " );
delay(2000);
graphdefaults();
cleardevice();

setcolor(GREEN);
sett ext style (BOLD_FONT,HORIZ_DIR, 3);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(360,200," END");
delay(2000);
graphdefaults();
cleardevice();
}
getch();
closegraph();
}

13
• Turbo C++ compiler : Turbo C++ is a discontin u edC++ compiler and integrated
development environment and computer language originally from Bor land. Most recent ly it
was distributed by Embarcadero Technologies, which acqu ired all of Borland's compiler tools
with the purchase of it sCodeGear division in 2008. The original Turbo C++ product line was
put on hold after 1994 and was revived in 2006 as an intr oductory-level IDE, essentially a
stripped -down version of their flagship C++Builder. Turbo C++ 2006 was released on
September 5, 2006 and was available in 'Explorer' and 'Professional' editions.

• COMPUTER SYSTEM :
I have used DELL INSPIRON, 8t h generation WITH INBUILT WINDOWS 10 Operating system
of 3.20 GHz INTEL Pentium Core pro cessor with i7technology computer { PC ). Dell
lnspiro n desktops and all-in-one PCs are designed with innovative technology and
latest features.

• OFFICE SOFTWARE PACKAGES:


have used MS word 2013 for creating our report to show about how we created this
website . For perfo rm ing of this project we have used MICROSOFT WORD OFFICE OF
2013 version. Microsoft Office 2013 is a version of M icrosoft Office, a productivity
suite for Microsoft Windows. It is the successo r to M icro soft Office 2010 and the
predecessor to M icro soft Office 2016.

14
• ALGORITHM OF ANIMATION PROGRAM CODE :
1) ALGORITHM : To create a moving animation using computer graphics .
INPUT : One number for color changing of tree.
OUTPUT : N Number Of Color Chang ing Tree With Different Colorful Changing
Fonts .
Steps : 1. Initiate graphics by declaring gd=DETECT, gm and defining this variables
by initgraph (&gd , &gm, " Y9.l:JL .9.mP.l,JJ r..t r.o.Q . .R .c;.lrn s." ) ;
2. Read value of n .
3. FOR LOADING SCREEN :
Repeat steps 2 for(i=0;i<n;i++)
{
set color( WHITE);
repeat st ep for( i=35;i<SSS;i++ )
{
line(2S+i,170,2S+ i,200);
}
Repeat step for(i=3S;i<SSS;i++)
{
set color(GREEN);
line(2S+i,170,2S+ i,200);
delay(l 0);

l
a. For Pisplayjng the colorful tree :
call the fu nct io ns w hich is cr eated outside the function :
firstCrown();delay(200);
secondCrown{);delay(200);
th ird Crown();de lay(200);
trunk();delay(200);

b. For displayingthe tree with changed color


Call the same fu nct io ns with changed color:
Usin the fu nction of graphics setcolor(RE D);which sets color to default color.

c. Using following functions set your default font and font style.
settextstyle(TRIP LEX_F ONT,HORIZ_DIR, 2);
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(300,400,"LECTURER, COMPUTER ENGINEERING
DEPARTMENT");

15
d. Display the tree for given n no of times with changing color.
e. End.

2) Algorithm : void firstCrown()


OUTPUT : First Crown Of The Tree
. STEP 1 : Start .
STEP 2 : Set The Fillin g Style Of Crown Using Setfillstyle Function .
STEP 3 : Creat e The Object Borders Using Line Function And Elli p se Function .
STEP 4 : Using Flood Fill Algorithm Fill Color To The Crown .
STEP 5 : End.
{
setf ill st yl e (SO LID_FlLL,GREEN);
lin e(300,40, 200,10 0);
lin e(300,40,400 , 10 0);
e llip se(300,100,180,360,98,30);
floodfill(310,50,WHITE);
}
SAME ALGORITHM FOR ALL FUNCTION THAT HAS BEEN CREATED OUT SIDE THE MAIN
FUNCTION.

s.o Actual Methodology Followed


• First I have discussed for my micro-project required resources.
• Then I have collected required informations from many of websites, Books and
from internet about recursion concept in C Language.
• Aft er this I have created my animation code of ( N Number Of Color Changing Tree
With Different Colorf ul Changing Fonts ) using grahics releted functions in TURBO-C
Compiler.
• Then I have tested my program code in TURBO C Compi ler for checking my program
code giving me expected output or not I .
• So if tested ok then program is fully functional , ready for use and demonstration.

• Aft er testing work of animation programs I have created a report to present my


animation program about how I used the graphics related concepts to make
aniamtion of C language .
• Aft er completing this report we have submitted it to our guidance.

16
6.0 Actual Resources U sed

S. No. Name of Resour ce/ material Specification s Q ty Remarks

1 WEBSITES www.recursionofC.com -
':l::l.':l::l.':1::1.,ce,ucsiQm;Q o,e 121,!:;Q[l)
':l::l.':l::l.':1::1., Claoguagece, ucsiQ□!:;Q□,CQM
www.grogramrecur sion.com
2 SOFTWARES TURBO C++ COMPILER I GOOGLE 01/01
CHROME BROWSER.
3 Computer system Dell inspiron2123, core- 01
i7processor with windows 10
operat ingsystem.
4 Office soft ware packages M S WORD office 2010 -

5 C program code Reference to lit eratu re review -

6 Algorithm, Flowchar t As reference to literatur e review -

7.0 Outputs of the Micro-Project


SOME OUTPUT HAS GIVEN BELOW :

WtLUJl11 ru UUH
- - - - - - -f Ml'1ITT:R Dt:r ARll1F.NT- - --- - - --
IN n 11:; nNl l'VIT IIJN I 1111 SIIIIIJIN(, VIJIi AII JIIT A U ll Cttn NC, IN(; nn:t:
.

[ 11l r r Nuatb,-r ol t l flr ', tiuu


w,:w t tot h" nfc t hr , olor of trrr
r-

17
16
8.0 Skill Developed/ learning out of this Micro-Project

• Graphics Animation Program writing skills is developed from this


micro- project.
• Problem solving skills .
• Creativity .
• Critical thinking skills.

9.0 Applications of this Micro-Project


• Comput er-generat ed imagery is used for movie making, video game
and computer program development, scientific modeling, and design for catalogs
and other commerc ial art.

• Some people even make computer graphics as art. We can classify applications of
computer graphics into four main areas: Display of information.

**************

17
Roll Name of the Students Enrollmen Remarks
Seat No
No. t No

2150 P rachi Vinod Chavan 2114320099 381134

2128 Nikita Laxmikant Wagh 2114320066 381112

2123 Jagruti Sumit Gulechha 2114320059 381107

2151 Tejashri Ramdas Sagar 2114320100 381135

2105 Harshada Mahendra Sagar 2114320038 381089

Signature of Faculty

You might also like