đĨī¸ CPU-Based 3D Renderer in C++
·
2min
·
Marcus Aas Jensen

Table of Contents
⨠3D Renderer is a CPU-based 3D renderer written in C++20, supporting simple primitive shapes and built entirely from scratch. It offers both perspective and orthographic projections and supports simple .obj
imports.
đģ GitHub Repository
đ ī¸ Features
- đ§ą Primitive Shapes: Render basic shapes like cubes, spheres, and pyramids.
- đŧī¸ .obj Import: Load and render simple .obj files.
- đ Projection Modes: Switch between perspective and orthographic projections.
- đĨī¸ CPU-Based: Built entirely from scratch without relying on external graphics libraries.
đŧī¸ Rendering Pipeline
The rendering pipeline transforms 3D objects from their local definitions into 2D rasterized pixels on the screen.
graph TD; A["Object Space<br/>(Local Space)<br/><small>Vertices defined relative to origin</small>"] --> B["World Space<br/><small>Apply transforms (position, rotation, scale)</small>"] --> C["Camera/View Space<br/><small>Relative to camera orientation</small>"] --> D["NDC<br/>(Normalized Device Coordinates)<br/><small>Range [-1, 1]</small>"] --> E["Screen Space<br/><small>Mapped to 2D pixel coords</small>"] --> F["Rasterization<br/><small>Z-Buffer + Triangle Filling</small>"];
đ¸ Gallery
Screenshots of the 3D Renderer in action
![]() | ![]() |