This project demonstrates the simulation of a Simple Pendulum using Computer Graphics concepts in OpenGL (GLUT).
The pendulum swings continuously between two extreme positions (A and B), representing rhythmic oscillatory motion. The project was developed as part of a Computer Graphics Lab Assignment.
✅ Rhythmic pendulum animation
✅ Fixed suspension point
✅ Circular pendulum bob
✅ Real-time motion using GLUT Timer
✅ Clean OpenGL rendering
✅ Lightweight and efficient implementation
| Technology | Purpose |
|---|---|
| C++ | Programming Language |
| OpenGL | Graphics Rendering |
| GLUT | Window & Animation Management |
simple-pendulum-opengl/
│
├── main.cpp
├── README.md
├── LICENSE
│
└── screenshots/
├── position_A.png
├── middle.png
└── position_B.pngThe pendulum motion is created using:
- Trigonometric functions (
sin,cos) - Angular motion updates
- GLUT Timer Function
- OpenGL primitive drawing
The bob position is calculated dynamically using:
bx = cx + length * sin(angle)
by = cy - length * cos(angle)The angle continuously changes to create oscillatory movement.
- Computer Graphics
- OpenGL Rendering
- Animation
- Trigonometry
- Coordinate System
- Event-driven Programming
g++ main.cpp -o pendulum -lglut -lGLU -lGL./pendulumThrough this project, the following concepts were practiced:
- OpenGL graphics programming
- Animation techniques
- Real-time rendering
- Basic physics simulation
- Use of GLUT callback functions
Department of Computer Science & Engineering (CSE)
University of Asia Pacific (UAP)
GitHub: https://github.com/tausif112
This project is licensed under the MIT License.
This project was developed for academic and learning purposes as part of the Computer Graphics laboratory coursework.


