3pp

December 25, 2025
1 min read
repo / demo

3pp - 3d perspective projection, is an example demo of rendering 3d models onto a 2d plane using perspective projection. The project is only for educational purposes only and is not meant for anything serious.

penger

Algorithm

It is derived from this formula:

Given a point (x, y, z) in 3d space, the 2d point on the screen is given by:

x' = xf / z
y' = yf / z

where f is the distance between the image plane and the center of projection.

Features

  • Scroll to zoom in/out
  • Drag to rotate the model

Run

You can run the demo by cloning the repo and install serve to run it locally.

npm install -g serve
git clone https://github.com/nibtr/3pp
cd 3pp
serve .

or visit the demo.

References

The demo is mostly referenced from this video by Tsoding. He explains the algorithm pretty clearly.

I also did some additional read on:

License

MIT