A CPU-based 3D renderer written in C++, supporting simple primitive shapes and built entirely from scratch.
Upload the .ppm
image file here to visualize the result: https://www.cs.rhodes.edu/welshc/COMP141_F16/ppmReader.html
Supports both perspective and orthographic projections.
Supports simple .obj
imports (assets/teapot.obj).
Work in progress...
-
Object Space (Local Space)
Vertices are defined relative to each object's origin.
Example: A unit cube centered at (0,0,0).
-
World Space
The object's local transform (position, rotation, scale) is applied.
All objects now share a common 3D world space.
-
Camera (View) Space
The scene is transformed relative to the camera’s position and orientation.
-
Normalized Device Coordinates (NDC)
All geometry is normalized into the range [-1, 1].
-
Screen Space
NDC is mapped to 2D pixel coordinates on the canvas.
-
Rasterization
Z-Buffer precalculated and used for triangles rasterization.

Vertices that are outside of the camera's view are ignored.
Wireframe triangles are rasterized onto the canvas.