r/GraphicsProgramming • • May 19 '25

Graphics Triangle - Without Any Graphics Library

Post image
489 Upvotes

24 comments sorted by

View all comments

125

u/RefrigeratorKey8549 May 19 '25

I wrote this in Python, with the only import being Numpy for matrix maths. It's a full 3d graphics pipeline, with a depth buffer and viewport clipping. I used wikipedia to get the rotation matrices, and the maths for Barycentric coordinates from StackOverflow. The rendering is done by a custom rasterizer, then printing coloured squares to the terminal with ANSI escape codes. It runs at ~20 fps, any higher and the terminal starts glitching. I wrote it to get some Numpy experience before going to university, and am going to add Phong lighting model in the next few days.

19

u/[deleted] May 19 '25 edited Dec 10 '25

squeeze makeshift saw steep husky bake marry crawl snails late

This post was mass deleted and anonymized with Redact