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