See https://scratch.mit.edu/projects/1124370930/ for a prettier example with a lot more features. Will do perspective-correct texture mapping if I get around to it. I wanted to make a texture mapper (in part cause I thought at full detail you don't need a crazy tri filling algorithm). In math I didn't really get taught how transformation matrices work (except for like 5 minutes on shears I think) so I just referenced the OpenGL fixed-function pipeline man pages. So it just took multiplying everything together and dividing by w to get wireframe stuff. I tried filling triangles a bunch of ways and ended up with an affine texture-mapped square...which I realized when I looked at a picture of affine texture mapping and it turned out that was what I had done (I had had affine texture mapping in my mind but didn't quite know what it was beyond the name). My initial method broke as soon as I tried importing uv coords from Blender however, so I tried redoing it by solving (though not super elegantly--I referenced Wikipedia for the closed-form inverse of a 3x3 matrix) for the coefficients in ax_1 + by_1 + c = u_1 dx_1 + ey_1 + f = v_1 ax_2 + ... and that turned out to work (and in fact got rid of some problems). Here's the Python program for exporting vertices & texture coordinates from an OBJ file exported from Blender: https://gist.github.com/jeandrek/56b04c480aa2ca29d36a2434f23f9a3a