Skip to content

A computer graphics project implementing two manipulable pyramids, interactive transformations, and visible-surface detection through BSP.

Notifications You must be signed in to change notification settings

jodi-ivan/painters-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.


📌 Note on Project Origin

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.


👀 Overview

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.


Features

1️⃣ Two 3D Pyramids (Triangle Mesh)

  • 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

2️⃣ Full Object Manipulation

Each pyramid can be manipulated independently:

Translation

  • Move along X axis
  • Move along Y axis
  • Move along Z axis

Rotation

  • 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

📷 Screenshots

(Add your screenshots here — e.g., rotating pyramids, occlusion examples.)

Uncliped Clipped2 Clipped1

About

A computer graphics project implementing two manipulable pyramids, interactive transformations, and visible-surface detection through BSP.

Topics

Resources

Stars

Watchers

Forks