https://github.com/ecsolticia/dekha-prototype
My first attempt at programming a 3D weak perspective projection renderer (prototype)
https://github.com/ecsolticia/dekha-prototype
3d cpp oop rasterization rasterizer render renderer
Last synced: 8 months ago
JSON representation
My first attempt at programming a 3D weak perspective projection renderer (prototype)
- Host: GitHub
- URL: https://github.com/ecsolticia/dekha-prototype
- Owner: EcSolticia
- License: mit
- Created: 2025-03-05T12:45:57.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-16T20:01:00.000Z (8 months ago)
- Last Synced: 2025-03-16T21:24:09.660Z (8 months ago)
- Topics: 3d, cpp, oop, rasterization, rasterizer, render, renderer
- Language: C++
- Homepage:
- Size: 40 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dekha-prototype
"Dekha", a project named after the Bengali word for the act of seeing, is my first attempt at implementing a 3D renderer utilizing [weak perspective projection](https://en.wikipedia.org/wiki/3D_projection#Weak_perspective_projection).
As a prototype, Dekha is able to "see" polygon meshes represented by a collection of distinct vertices and draw edges connecting them as projected onto the a plane.
The output is represented in the terminal as ASCII graphics.
# Note
This project is a mere prototype for a more fully-fledged version of "Dekha", [EcSolticia/dekha](https://github.com/ecsolticia/dekha) (currently under-development).
# Example
## Input:
- The camera faces the z-axis in the positive direction by default (represented by the rotation vector (0, 0, 0) within the program for convenience).
- A triangle with the following vertices is initialized:
```
(0, 0, 1),
(10, 0, 2),
(0, 10, 1)
```
## Output:
```
--------------------------------------------------
-------------------------#------------------------
-------------------------#------------------------
-------------------------#------------------------
-------------------------##-----------------------
-------------------------##-----------------------
-------------------------#-#----------------------
-------------------------#-#----------------------
-------------------------#--#---------------------
-------------------------#--#---------------------
-------------------------#---#--------------------
-------------------------######-------------------
--------------------------------------------------
```