This project is optimised to draw triangles in a 3d perspective with flat shading determined by distance. On my machine, drawing the figure here [pyramid front faces, 3 triangles] can be done at 11 frames per second. By editing this project you can add arbitrarily many triangles to be rendered. This project has two sprites: one that turns lists of triangles in 3d into 2d triangles and applies shading, and one that renders shaded 2d triangles as fast as it possibly can. If you look at the script for "3drend", you'll see that dummy items are being added to the lists x1 and x2. these are necessary because in order to make it work at a decent speed I needed to update list-items in-place by replacing them. But anyways, for the purpose of this example, you can move the "camera" using the arrow keys and change the depth by pressing w and s.