You are on page 1of 14

A

MICRO-PROJECT REPORT
ON
“DESIGN AN ANALOG CLOCK”
Submitted in fulfillment of the requirement for the internal assessment for
the subject computer Graphics for,

DIPLOMA SECOND YEAR IN


COMPUTER ENGINEERING

Sr.NO ROLL.NO STUDENT NAME ENROLLMENT


NUMBER
1 32 VISHAL DIGAMBAR CHAVARE 2015230052
2 35 Swapnil Satyawan Ghodake 2015230055
3 22 Chaitanya Santosh Parchande 2015230040
4 23 Swanand Sandip Kavathekar 2015230041

Under the guidance of

[ Mr.Rohit Bangosavi ]

Professor, Computer Department

DEPARTMENT OF COMPUTER ENGINEERING

Three Years Diploma Programme in Engineering & Technology of Maharashtra


State Board of Technical Education, Mumbai (Autonomous)
ISO 9001:2008 (ISO/IEC-27001:2013)
At

[ NEW SATARA INSTITUDE. KORTI PANDHARPUR ]

1
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION, MUMBAI

Certificate
This is to certify that Mr.. VISHAL DIGAMBAR CHAVARE

Roll No: 32 of Second Semester of Computer engineering

Diploma Programme in Engineering & Technology at [ NEW SATARA

INSTITUDE. KORTI PANDHARPUR ] , has completed the Micro Project

satisfactorily in Subject DATASTRUCTURE USING IN C in the academic year

2021-2022 as per the MSBTE prescribed curriculum of I Scheme.

Place: Pandharpur Enrollment No: 2015230052

Date : / / 2022 Exam. Seat No:

Project Guide Head of the Department


Principal

Seal of Institute
2
ACKNOWLEDGEMENT
With all respect and gratitude, I would like to thank all people who have helped me directly or indirectly
for the completion of this Project work.

I thank my seminar guide for helping me to understand the project topic conceptually in every phase of
project work.

I express my heartily gratitude towards Head of department of Computer Engineering for guiding me to
understand the work conceptually and also for providing necessary information and required resources
with his constant encouragement to complete this project work.

Last but not the least, I thank to all the Teaching & Non teaching staff members of Computer
Engineering Department for providing necessary information and required resources.

I am ending this acknowledgement with deep indebtedness to my friends who have helped m

3
ABSTRACT
The project is idea to display the clock with computer graphics.

this project just used the local time,fetching from the computer and display it on thescreen.this project
implements the wall clock with the round circular boardand three conic geometric which forms the
different(sec,min &hour)hands.Here we are going to use time function to diplay time.In this project we
aregoing to get output has the current time

4
INDEX

SR.NO TOPICS PAGE NO.


1 Introduction 6
2 Requirements 7
3 Implementation 8
4 Conclusion 14
5 References 15

5
CHAPTER 1
INTRODUCTION

➢OVERVIEW :

The aim of this project is to implement an application package of Computergraphics using OpenGL.
Here we represent the concepts displaying Analog clock inOpenGL.

➢ABOUT GRAPHICS OpenGL:

Activities as wideranging as filmmaking, publishing, banking and educationcontinue to undergo


revolutionary changes as these technologies alter the ways inwhich we conduct our daily activities.
The combination of computers, network andthe complex human visual system, through computer
graphics, has led to new ways of displaying information seeing virtual worlds and communicating
with people andmachines.A class in computer graphics allows the instructor to build all these topics
in away that can be both informative and fun. Low level algorithms such as those thatdraw lines or
fill polygons are used in OpenGL.The development of OpenGL resolved both of the difficulties that
wasexperienced with other APIs and with the alternative of using home – brewed s/w .OpenGL today
is supported in all platforms
A clock or watch is called "analog" when it has moving hands and hours markedfrom 1 to 12 to
show you the time.Analog clocks usually indicate time using angles. The most commonclock face
uses a fixed numbered dial or dials and moving hand or hands. It usually has a circularscale of
12hours,which can also serve as a scale of 60minutes,and 60seconds if theclock has a second hand.
Many other styles and designs have been used throughout theyears, including dials divided into 6,
8, 10, and 24 hours.The only other widely used clock face today is the24 hour analog dial , because
of the use of 24 hour time inmilitary organizations and timetables

6
CHAPTER 2

REQUIREMENT

SOFTWARE REQUIREMENT:
The project requires access to the OpenGL graphics library functions . Someof
these library functions are contained in unique to C++ library header files such as
1) GL/glut.h

2) math.h

3) windows.h

4) time.h

To write, compile and link the program , a suitable C integrated


developmentenvironment is required . Microsoft Visual Studio/Code Blocks may
be suitable in this regard.

Software requirement are:


1.Window Operating System

2. Microsoft Visual Studio

3. Code Blocks

HARDWARE REQUIREMENT:
The minimum/recommended hardware configuration required for developing
theproposed software is given below :
1. PENTIUM-2 and above compatible systems.

2. 128 MB RAM.

3. Approximately 1 MB free space in the hard disk.

4. Hard disk access time must be less than 19 milliseconds

7
CHAPTER 3
IMPLEMENTATION
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
#include<math.h>
#include<dos.h>
/*void drawdecor();*/
void drawclock();
void drawclogic();
void usecolor();
void main()
{
clrscr();
int gdriver=DETECT ,gmode;
initgraph(&gdriver,&gmode,"c:\\tc\\bg
i");
cleardevice();
/*Clock layout and logic called in
usecolor method*/
usecolor();
getch();
closegraph();
}
/*Draw clock steps method */
void drawclock()
{
/*SIDE BORDER*/
rectangle(0,0,600,470);
rectangle(5,5,595,465);
/*CLOCK BOX*/
setcolor(25);
rectangle(145,65,500,415);
line(175,35,145,65);
line(530,35,500,65);
line(530,385,500,415);
line(175,35,530,35);
line(530,35,530,385);
line(275,60,295,40);
line(325,60,345,40);
line(275,60,325,60);
line(295,40,345,40);
/*CLOCK TITLE*/

8
setcolor(15);
rectangle(20,150,130,280);

/*gotoxy(5,5);
printf("demla \n,pramod \n,
lavina\n");*/
setcolor(10);
outtextxy(27,195,"Designed By:");

outtextxy(27,215,"demlaip");

outtextxy(27,235,"pramod");

outtextxy(27,255,"lavina");

cout<<" ";
rectangle(25,155,125,18
0);
setcolor(YELLOW);
outtextxy(27,160,"An
alog Clock");
/*CLOCK CIRCLES*/
setbkcolor(0);
setcolor(4); /*RED*/
circle(320,240,3);
setcolor(4);
/
*setfillstyle(6,13);
*/
circle(320,240,150);
circle(320,240,165);
/*CLOCK NUMBERS*/
setcolor(14);

9
outtextxy(314,98,"12
");
outtextxy(384,114,"1
");
outtextxy(434,163,"2
");
outtextxy(454,230,"3
");
outtextxy(317,369,"6
");
outtextxy(177,230,"9
");
outtextxy(436,300,"4
");
outtextxy(195,302,"8
");
outtextxy(195,163,"1
0");
outtextxy(244,112,"1
1");
outtextxy(388,353,"5
");
outtextxy(248,353,"7
");
}
/*CALCULATION Logic
of draw clock*/

10
void drawclogic()
{
float s;
float df;
float anf=3.14;
int x,y;
int q,w;
int ta,d;
int count=0;
struct time t1;
gettime(&t1);
float
angle=4.712389+t1.ti
_sec*.1047198;
float
an=4.712389+t1.ti_min*.1047198;
while(!kbhit())

setcolor(count);

rectangle(20,20,130,90);

gettime(&t1);
gotoxy(5,5);
printf("%d: %d: %d",

cout<<" ";
rectangle(25,25,125,45)
;
setcolor(YELLOW);

11
outtextxy(27,30,"Digital Time");

gotoxy(5,5);
angle=4.712389+t1.ti_sec*.1047198
;
an=4.712389+t1.ti_min*.1047198;

anf=4.712389+t1.ti_hour*5*.104719
8 ;
if(t1.ti_min>=12&&t1.ti_min<24)

{
anf=anf+2*.1047198;

}
if(t1.ti_min>=24&&t1.ti_min<36)

{
anf=anf+(3*.1047198);

}
if(t1.ti_min>=36&&t1.ti_min<48)

{
anf=anf+(4*.1047198);

}
if(t1.ti_min>=48&&t1.ti_min<60)

{
anf=anf+(5*.1047198);

}
setlinestyle(0,0,0);

setcolor(0);

line(320,240,x,y);

line(320,240,q,w);

line(320,240,ta,d);

x=320+140*cos(angle);

12
y=240+140*sin(angle);

q=320+120*cos(an);

w=240+120*sin(an);

ta=320+80*cos(anf);

d=240+80*sin(anf);

setcolor(10);

line(320,240,x,y);

setcolor(9);

line(320,240,q,w);

setcolor(4);

OUTPUT:

13
14

You might also like