Perspective projection demo
This is an implementation of the perspective projection equations. We use them to project the vertices of a cube, and then draw line segments between these, to render a wireframe cube.
We use the same color for the edges of each face of the cube. Because each edge is shared by two faces, the color you see depends on the order in which we draw them.