Nothing Special   »   [go: up one dir, main page]

Micro Project CGR

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

A

PROJECT REPORT
ON

“TAJMAHAL BY USING SIMPLE GRAPHICS”

SUBMITTED BY

[156]Miss. Shaikh Mariyam Fakaruddin [164]Miss.Sonawane Sakshi Janardhan

[169]Miss.Gawail Siddhi Balasaheb [170]Miss.Gondkar Samiksha Annasaheb

Under guidance of

MR.V.G.LACHAKE

DEPARTMENT COMPUTER TECHNOLOGY

Sanjivani rural education society’s

SANJIVANI K.B.P.POLYTECHNIC

KOPARGOAN-423603,DIST:AHMEDNAGAR

2022-2023

1|Page
Sanjivani Rural Education Society’s

SANJIVANI K.B.P. POLYTECHNIC


DEPARTMENT OF COMPUTER TECHNOLOGY

CERTIFICATE
This is to certify that the project report entitled

“TAJMAHAL BY USING SIMPLE GRAPHICS”


SubmittedBy
[156]Miss. Shaikh Mariyam Fakaruddin [164]Miss.Sonawane Sakshi Janardhan

[169]Miss.Gawail Siddhi Balasaheb [170]Miss.Gondkar Samiksha Annasaheb

Under our supervision and guidance for partial fulfillment of the requirement for
Diploma in Computer Technology affiliated to
Maharashtra State Board of Technical Education,

Mumbai for academic year


2022-2023

Mr.V.G. LACHAKE Mr.G.N.JORVEKAR


Project.guide HOD

2|Page
ACKNOWLEDGMENT

We would take this opportunity to express our sincere thanks and gratitude to our
Project Guide Prof. V.G.LACHAKE Department of Computer Technology,
Sanjivani K.B.P.Polytechnic, Kopargaon. For his vital guidance and support in
completing this project. Lots of thanks to the Head of Computer technology
Department Mr. G.N. Jorvekar for providing us with the best support we ever had.
We like to express our sincere gratitude to Mr. A. R. Mirikar, Principal, Sanjivani
K. B. P. Polytechnic, Kopargaon for providing a great platform to complete the
project within the scheduled time.
Last but not the least; we would like to say thanks to our family and friends for
their never-ending love, help, and support in so many ways through all this time. A
big thanks to all who have willingly helped us out with their ability.

Miss. Shaikh Mariyam Fakaruddin[156]

Miss.Sonawane Sakshi Janardhan[164]

Miss.Gawail Siddhi Balasaheb[169]

Miss.Gondkar Samiksha Annasaheb[170]

3|Page
INDEX

Sr.no Title Page.no


1 PREFACE AND OBJECTIVES 01
2 METHODOLOGY 02
3 SOURCE CODE 05
4 OUTPUT 15
5 CONCULSION 16
6 REFERENCE 17

4|Page
PREFACE

C program to draw the Taj Mahal using graphics


In Turbo C graphics the graphics.h functions are used to draw different shapes(like
a circle, rectangle, etc), display text(any message) in different formats (different
fonts and colors). By using graphics.h programs, animations, and also games can
be designed. These can be useful for beginners.

OBJECTIVES

The main objectives of this project are:

 To implement the features of graphics.


 To interface the applications of graphics to the real world.
 To give some benefits to the disability.
 To make the life easier.
 To become familiarization with Graphics and its logical coding.

5|Page
METHODOLOGY

This project was done with the help of C-Programming Language. Different
methods are performed in order to make it more applied and efficient. C Graphics
programming is very easy and interesting. We used graphics programming for
developing our projects, for designing, animation etc. It's not like traditional C
programming in which you have to apply complex logic in your program and then
you end up with a lot of errors and warnings in your program. In C graphics
programming you have to use standard library functions ( need not worry if you
don't know functions ) to get your task done. Just you pass arguments to the
functions and it's done. Many graphic functions are coded on its header file
<graphics.h>.
Sample Graphics Code:

This program initializes graphics mode and then closes it after a key is
pressed. To begin with we have declared two variables of int type gd and gm for
graphics driver and graphics mode respectively, you can choose any other variable
name as you wish. DETECT is a macro defined in "graphics.h" header file, then
we have passed three arguments to initgraph function first is the address of gd,

6|Page
second is the address of gm and third is the path where your BGI files are present
(we have adjusted this accordingly where our turbo compiler is installed).
Initgraphfunction automatically decides an appropriate graphics driver and mode
such that maximum screen resolution is set, getch() helps us to wait until a key is
pressed, closegraph() function closes the graphics mode and finally return
statement returns a value 0 to main indicating successful execution of your
program.
(4)
Some of the function included in<graphics.h> used in our project:

i) Line function:

line function is used to draw a line from a point(x1,y1) to point(x2,y2)


i.e.(x1,y1) and(x2,y2) are end points of the line.The code given below
draws a line.

Declaration :- void line(int x1, int y1, int x2, int y2);

ii) Circle function:

Circle function is used to draw a circle with center (x,y) and


third parameter specifies the radius of the circle. The code given
below draws a circle.
Declaration :- void circle(int x, int y, int radius);
<stdio.h>:
The C programming language provides many standard
library functions for file input and output. These functions make up
the bulk of the C standard library header <stdio.h>.The I/O
functionality of C is fairly low-level by modern standards; C abstracts

7|Page
all file operations into operations on streams of bytes, which may be
"input streams" or "output streams". Unlike some earlier programming
languages, C has no direct support for random-access data files; to
read from a record in the middle of a file, the programmer must create
a stream, seek to the middle of the file, and then read bytes in
sequence from the stream.

Stdio.h functions used in our project:

 Sprint
 If/else
 Break
 While
 Struct

 <conio.h>:
conio.h header used in c programming contains functions for
console input/output. Some of the most commonly used functions of
conio.h are clrscr, getch, getche, kbhit etc. Functions of conio.h can be
used to clear screen, change color of text and background, move text,
check if a key is pressed or not and many more. conio.h file is
provided by Borland turbo c compiler and GCC compiler doesn't
support it.

Conio.h functions used in our project:

 clrscr
 getch
 kbhit

8|Page
SOURCE CODE
#include <conio.h>
#include <graphics.h>
#include <stdio.h>

// Declaring functions used


// in this program

void taj_body();

void left_minars();

void right_minars();

void main()
{

int gd = DETECT, gm;

// Initialize of gdriver with

// DETECT macros

initgraph(&gd, &gm, "C:\\turboc3\\bgi");

// Calling taj_body() function

taj_body();

// Calling left_minars() function

left_minars();

// Calling right_minars() function

right_minars();

// Holding screen for a while

getch();

9|Page
// Close the initialized gdriver

closegraph();
}
void taj_body()
{

// Main Base

rectangle(10, 650, 1350, 680);

rectangle(550, 300, 800, 650);

rectangle(540, 290, 810, 650);

// Left Door Line

line(600, 650, 600, 400);

// Right Door Line

line(750, 650, 750, 400);

line(600, 400, 675, 390);

line(675, 390, 750, 400);

arc(675, 240, 330, 210, 155);

// Main Finial

line(655, 85, 675, 30);

line(675, 30, 695, 87);

// Left Side

line(540, 315, 445, 315);

arc(490, 315, 0, 180, 45);

// Left Finial

line(480, 270, 490, 250);

line(490, 250, 500, 270);

10 | P a g e
// Left Vertical Line

line(445, 315, 445, 355);


// Lower Left Join

line(445, 355, 540, 355);

// Again Lower Left Join

line(445, 375, 540, 375);

// Left Tangent

line(445, 355, 375, 370);

// Lower Left Tangent

line(445, 375, 375, 390);

// Left Last Vertical

line(375, 370, 375, 650);

// Middle Left Rectangle

rectangle(450, 390, 530, 650);

// Left Rectangle Divider

line(450, 520, 530, 520);

// Left Rectangle Side Structure

line(440, 650, 440, 390);

line(385, 650, 385, 405);

line(440, 390, 385, 405);

// Divider

line(440, 520, 385, 520);

// Creating Left Lower Spike

11 | P a g e
line(460, 650, 460, 585);

line(520, 650, 520, 585);


line(460, 585, 490, 555);
line(520, 585, 490, 555);

// Creating Left Upper Spike

line(460, 520, 460, 455);

line(520, 520, 520, 455);

line(460, 455, 490, 425);

line(520, 455, 490, 425);

// Right Side

line(810, 315, 905, 315);

arc(860, 315, 0, 180, 45);

// Right Finial

line(850, 270, 860, 250);

line(860, 250, 870, 270);

// Right Vertical Line

line(905, 315, 905, 355);

line(905, 355, 810, 355);

// Lower Right Join

line(905, 355, 810, 355);

// Again Right Left Join

line(905, 375, 810, 375);

// Right Tangent

line(905, 355, 975, 370);

12 | P a g e
// Lower Right Tangent

line(905, 375, 975, 390);

// Right Last Vertical

line(975, 370, 975, 650);

// Middle Right Rectangle

rectangle(820, 390, 900, 650);

// Right Rectangle Divider

line(820, 520, 900, 520);

// Right Rectangle Side Structure

line(910, 650, 910, 390);

line(965, 650, 965, 405);

line(910, 390, 965, 405);

// Divider

line(910, 520, 965, 520);

// Creating Right Lower Spike

line(830, 650, 830, 585);

line(890, 650, 890, 585);

line(830, 585, 860, 555);

line(890, 585, 860, 555);

// Creating Right Upper Spike

line(830, 520, 830, 455);

line(890, 520, 890, 455);

line(830, 455, 860, 425);

13 | P a g e
line(890, 455, 860, 425);
}

void left_minars()
{

// 1st Left Minar

// 1st Step

line(20, 650, 30, 500);

line(120, 650, 110, 500);

line(110, 500, 30, 500);

// 2nd Step

line(30, 500, 20, 480);

line(110, 500, 120, 480);

line(120, 480, 20, 480);

line(30, 480, 40, 330);

line(110, 480, 100, 330);

line(40, 330, 100, 330);

line(40, 330, 30, 310);

line(100, 330, 110, 310);

line(110, 310, 30, 310);

// 3rd Step

line(40, 310, 50, 160);

line(100, 310, 90, 160);

line(50, 160, 90, 160);

line(50, 160, 40, 140);

14 | P a g e
line(90, 160, 100, 140);

line(40, 140, 100, 140);

line(40, 140, 60, 120);

line(100, 140, 80, 120);

line(60, 120, 80, 120);

line(60, 120, 70, 100);

line(70, 100, 80, 120);

// 2nd Left Minar

// 1st Step

line(170, 650, 180, 575);

line(270, 650, 260, 575);

line(180, 575, 260, 575);

// 2nd Step

line(180, 575, 170, 555);

line(260, 575, 270, 555);

line(170, 555, 270, 555);

line(180, 555, 190, 480);

line(260, 555, 250, 480);

line(190, 480, 250, 480);

// 3rd Step

line(190, 480, 180, 460);

line(250, 480, 260, 460);

line(180, 460, 260, 460);

15 | P a g e
line(190, 460, 200, 385);

line(250, 460, 240, 385);

line(200, 385, 240, 385);

line(200, 385, 190, 365);

line(240, 385, 250, 365);

line(190, 365, 250, 365);

line(190, 365, 210, 345);

line(250, 365, 230, 345);

line(210, 345, 230, 345);

line(210, 345, 220, 325);

line(220, 325, 230, 345);


}

void right_minars()
{

// 1st Right Minar


// 1st Step

line(1340, 650, 1330, 500);

line(1240, 650, 1250, 500);

line(1330, 500, 1250, 500);

// 2nd Step

line(1330, 500, 1340, 480);

line(1250, 500, 1240, 480);

line(1240, 480, 1340, 480);

line(1330, 480, 1320, 330);

line(1250, 480, 1260, 330);

16 | P a g e
line(1320, 330, 1260, 330);

line(1320, 330, 1330, 310);


line(1260, 330, 1250, 310);

line(1250, 310, 1330, 310);

// 3rd Step

line(1320, 310, 1310, 160);

line(1260, 310, 1270, 160);

line(1310, 160, 1270, 160);

line(1310, 160, 1320, 140);

line(1270, 160, 1260, 140);

line(1320, 140, 1260, 140);

line(1320, 140, 1300, 120);

line(1260, 140, 1280, 120);

line(1300, 120, 1280, 120);

line(1280, 120, 1290, 100);

line(1290, 100, 1300, 120);

// 2nd Right Minar


// 1st Step

line(1090, 650, 1100, 575);

line(1190, 650, 1180, 575);

line(1100, 575, 1180, 575);

// 2nd Step

line(1100, 575, 1090, 555);

line(1180, 575, 1190, 555);

17 | P a g e
line(1090, 555, 1190, 555);

line(1100, 555, 1110, 480);


line(1180, 555, 1170, 480);

line(1110, 480, 1170, 480);

// 3rd Step

line(1110, 480, 1100, 460);

line(1170, 480, 1180, 460);

line(1180, 460, 1100, 460);

line(1110, 460, 1120, 385);

line(1170, 460, 1160, 385);

line(1120, 385, 1160, 385);

line(1110, 365, 1120, 385);

line(1160, 385, 1170, 365);

line(1110, 365, 1170, 365);

line(1110, 365, 1130, 345);

line(1170, 365, 1150, 345);

line(1130, 345, 1150, 345);

line(1130, 345, 1140, 325);

line(1140, 325, 1150, 345);

18 | P a g e
OUTPUT

Output of tajmahal by using simple and basic graphics

19 | P a g e
CONCLUSION

This project is one of the sample project on Computer Graphics.. Though


many difficulties were faced during the project as well as many errors occurred, we
became succeed to compile and run the program. There may be some limitations
on this project as well, so, in the near future we would like to be hopeful in further
improvements.We are highly obliged to all helping hands and to all inspirations to
make this project successful. Well this project will be applicable to most of all. As
well as, we are more hopeful for more advice, new ideas and inspiration to make
more other projects.
To had tried our best to include each and every basic features of graphics in
our projects. We aimed it to be an interfacing application to the real world that
means our project must not be an project for any examination but also applicable
for real world use. We have able to give some benefits to the disability. It
somehow makes our life easier in this or that way. From this very project we were
able to achieve various knowledge in computer graphics and also in logical
coding. We refresh our knowledge in C Programming. Moreover we also gained an
experience of group work, team coordination. We learned how team work is very
much important in engineering field.

20 | P a g e
REFERENCE

 https://youtube.be/VQ3iPT-HYQQ
 https://youtube.be/NTbxgfGsWrg

21 | P a g e

You might also like