https://github.com/a-voronov/computer-graphics-from-scratch
Computer Graphics from Scratch: Lightweight C++ implementation with no external libraries
https://github.com/a-voronov/computer-graphics-from-scratch
computer-graphics cpp
Last synced: about 1 year ago
JSON representation
Computer Graphics from Scratch: Lightweight C++ implementation with no external libraries
- Host: GitHub
- URL: https://github.com/a-voronov/computer-graphics-from-scratch
- Owner: a-voronov
- License: mit
- Created: 2025-06-22T23:09:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-24T12:21:56.000Z (about 1 year ago)
- Last Synced: 2025-06-24T13:34:30.164Z (about 1 year ago)
- Topics: computer-graphics, cpp
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Computer Graphics from Scratch
C++ implementation of [Computer Graphics from Scratch](https://gabrielgambetta.com/computer-graphics-from-scratch/) book for self-studying purposes.
The book is using JavaScript and HTML Canvas to implement logic and display results.
It seems to me that the easiest implementation in C++ without using any libraries, is to render results straight into the bmp files. So I've added a quick [bmp implementation](/examples/bmp.h).
## Run Examples
```
mkdir -p bin results
clang++ -std=c++17 examples/.cc -o bin/
bin/ && open results/.bmp
```
## Results
| [01 - Basic Raytracing](/examples/01-basic-raytracing.cc) | [02 - Diffuse Reflection](/examples/02-diffuse-reflection.cc) | 03 - Specular Reflection |
|---|---|---|
|  |  | |