This project implements various computer graphics algorithms using C++ and OpenGL. The focus is on fundamental rendering techniques, line drawing, ball bouncing projection, and ray tracing.
Bresenham's algorithm is an efficient way to draw lines on a raster display. It uses integer calculations to determine the closest pixel for a smooth and accurate line without floating-point operations.
A parametric line-clipping algorithm used in computer graphics for convex polygon clipping. It determines the visible portion of a line segment that lies inside a convex polygonal region.
Projection transforms 3D objects onto a 2D screen. This project implements:
- Orthographic Projection: Preserves parallel lines without perspective distortion.
- Perspective Projection: Mimics the way the human eye perceives depth.
Extends the projection technique by adding rotational transformations, allowing objects to be viewed from different angles before projecting them onto a 2D plane.
Unlike traditional algorithms, this technique avoids division operations, making it efficient for real-time applications where precision and speed are crucial.
Determines which parts of a 3D object should be visible in a scene, helping to remove hidden surfaces and improve rendering performance.
Uses bitmap images as textures in OpenGL to display graphical elements with pixel-perfect accuracy.
A powerful rendering technique that simulates realistic lighting by tracing rays from the camera to light sources. It accounts for:
- Reflection
- Refraction
- Shadows
- Light absorption
This simulation demonstrates realistic bouncing ball physics using OpenGL. The ball follows a natural bouncing motion with gravity applied. The motion includes:
- Gravity-affected movement
- Collision detection with the ground
- Shape deformation upon impact
- Dynamic motion adjustments
- C++ ⚡
- OpenGL 🎨
- GLUT (OpenGL Utility Toolkit)
Clone the repository:
git clone https://github.com/AhmedRafid023/ComputerGraphics.git
cd computer-graphicsCompile and run:
g++ main.cpp -o graphics -lGL -lGLU -lglut
./graphicsContributions are welcome! Feel free to fork the project and submit a PR.
MIT License © 2025 Ahmed Rafid