Skip to content

tausif112/Interactive-Graphics-Clock-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•’ Interactive Graphics Clock System

OpenGL Language GLUT Status

A real-time analog clock simulation developed using OpenGL and GLUT, demonstrating classic Computer Graphics algorithms and interactive graphical rendering techniques.


๐Ÿ“Œ Project Overview

The Interactive Graphics Clock System is a Computer Graphics project developed using C++, OpenGL, and GLUT.

This application simulates a fully functional analog clock that synchronizes with the system time and updates in real time. The project focuses on implementing fundamental Computer Graphics algorithms, including line drawing and circle drawing techniques, rather than relying solely on built-in graphics primitives.

The clock supports multiple visual themes and provides an interactive user experience through keyboard controls.


๐ŸŽฅ Demo

๐ŸŽฌ Demo Video

โœจ Features

โœ… Real-time analog clock synchronization
โœ… Multiple visual themes
โœ… Interactive keyboard controls
โœ… Dynamic hour, minute, and second hands
โœ… Concentric clock face design
โœ… Algorithm-based graphics rendering
โœ… Lightweight and efficient implementation


๐Ÿ› ๏ธ Technologies Used

Technology Purpose
C++ Programming Language
OpenGL Graphics Rendering
GLUT / FreeGLUT Window Management & Event Handling
Code::Blocks Development Environment

๐Ÿ“‚ Project Structure

Interactive-Graphics-Clock-System/
โ”‚
โ”œโ”€โ”€ main.cpp
โ”œโ”€โ”€ Interactive Graphics Clock System.cbp
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”‚
โ””โ”€โ”€ images/
    โ”œโ”€โ”€ Screenshot_1.png
    โ””โ”€โ”€ Screenshot_3.png

โš™๏ธ How the Program Works

The application retrieves the current system time and dynamically updates the positions of the clock hands.

The project utilizes:

  • Bresenham Line Drawing Algorithm
  • Midpoint Circle Algorithm
  • Scan Conversion Circle Filling
  • Trigonometric calculations for hand positioning
  • GLUT Timer Functions for real-time updates

The positions of the clock hands are calculated using trigonometric functions:

x = centerX + radius * cos(angle);
y = centerY + radius * sin(angle);

The display refreshes every second to ensure accurate synchronization with system time.


๐Ÿง  Core Graphics Algorithms

๐Ÿ”น Bresenham Line Drawing Algorithm

Used for:

  • Hour hand rendering
  • Minute hand rendering
  • Second hand rendering
  • Hour markings
  • Minute markings

๐Ÿ”น Midpoint Circle Algorithm

Used for:

  • Clock boundary creation
  • Decorative concentric circles

๐Ÿ”น Scan Conversion Circle Filling

Used for:

  • Multi-layer clock face rendering
  • Center pivot rendering

๐ŸŽฎ User Controls

Key Action
1 Activate Theme 1
2 Activate Theme 2
ESC Exit Application

๐Ÿ“ธ Output Screenshots

๐Ÿ”น Theme 1

Theme 1


๐Ÿ”น Theme 2

Theme 2


๐Ÿš€ Compilation & Execution

Compile

g++ main.cpp -o clock -lglut -lGLU -lGL

Run

./clock

๐Ÿ“– Learning Outcomes

Through this project, the following concepts were practiced:

  • Computer Graphics Fundamentals
  • Raster Graphics Algorithms
  • OpenGL Graphics Programming
  • Real-Time Rendering
  • Event-Driven Programming
  • Interactive User Interface Design
  • Mathematical Visualization Techniques

๐Ÿ‘จโ€๐Ÿ’ป Author

Md Tausif Uddin

Department of Computer Science & Engineering (CSE)
University of Asia Pacific (UAP)

GitHub: https://github.com/tausif112


๐Ÿ“œ License

This project is licensed under the MIT License.


โญ Acknowledgement

This project was developed as part of the Computer Graphics Laboratory coursework and demonstrates the practical implementation of classical graphics algorithms using OpenGL and GLUT.

About

Interactive real-time analog clock simulation demonstrating classic Computer Graphics algorithms using OpenGL and GLUT.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages