3D Pyramids Renderer (Painter Algorithm + BSP)**
3D Pyramids Renderer — Perspective Projection, Transformations & Hidden Surface Removal
A computer graphics project implementing two manipulable pyramids, interactive transformations, and visible-surface detection through BSP.
This project was originally developed as part of my 3D Computer Graphics and Animation course (December 2015). In 2025, I migrated the code from an old local machine into GitHub, so commit dates reflect the upload, not the original development time.
This application is a simple 3D rendering engine built from scratch, demonstrating:
- Perspective projection
- Triangle mesh rendering
- Object transformations (translation + rotation on all axes)
- Visible surface detection
- Basic scene management
- Support for loading additional 3D objects
- Manual painter/BSP hybrid for correct occlusion
Everything is rendered without external libraries — all math, rendering, and visibility logic are implemented manually.
- Triangular pyramid
- Square pyramid
- Each face has unique colors
- You define the world coordinates
- Both are placed in the World Coordinate System (WCS)
- Displayed with perspective projection
Each pyramid can be manipulated independently:
- Move along X axis
- Move along Y axis
- Move along Z axis
- Rotate around X axis
- Rotate around Y axis
- Rotate around Z axis
Transformations apply to each object separately — they are not linked.
3️⃣ Hidden Surface Removal (BSP Tree / Painter’s Algorithm)
The program implements:
- Binary Space Partitioning (BSP) for visibility ordering
- Painter algorithm for sorted rendering
- Only the faces facing the viewer are visible
- Faces hidden behind the other pyramid are correctly occluded
This includes:
- Front pyramid hiding the back one
- Partial occlusion
- Correct ordering even after rotations or translations
(Add your screenshots here — e.g., rotating pyramids, occlusion examples.)


