A collection of computer graphics algorithms implemented in C++ to explore fundamental graphics concepts, including line drawing techniques and rasterization.
- Digital Differential Analyzer (DDA) — Draws lines by incrementally calculating intermediate points between two endpoints.
- Bresenham’s Line Algorithm (BSA) — Uses integer-based calculations to efficiently determine the pixels needed to draw a straight line.
Graphics/
├── Line Drawing Algorithm/
│ ├── BSA.cpp
│ ├── DDA.cpp
│ └── makefile
└── README.md
- A C++ compiler, such as
g++ - GNU Make
On Arch Linux, install the required tools with:
sudo pacman -S gcc makegit clone https://github.com/Strangerfuture/Graphics.git
cd GraphicsNavigate to the line drawing directory:
cd "Line Drawing Algorithm"Compile the DDA algorithm:
g++ DDA.cpp -o dda
./ddaCompile the Bresenham’s Line Algorithm:
g++ BSA.cpp -o bsa
./bsaAlternatively, use the provided Makefile if it defines suitable build targets:
make- Understand raster graphics and pixel-based line rendering.
- Compare incremental line drawing algorithms.
- Explore the differences between floating-point and integer-based calculations.
- Practice implementing computer graphics algorithms in C++.
- C++
Strangerfuture
GitHub: @Strangerfuture