This is not a actual answer to your question. But something like learning exercise i suggest for you, if you want to learn about 3D graphics matrices.
Make you own super simple CPU based 3D rendering library. For start you should use something like canvas which enables to draw polygones (triangles). I sugests SDL. For algebra maybe armadillo, but it is little overkill. You can be fine with some simple matrix4x4 and vector2/3/4 class (or write own).
Then go to opengl documentation and code these function:
gl_begin //(support only triangles)
gl_color //color will help you to determine which triangle is which one
glMatrixMode // it is not neccesery to have matrix stack for you, so you can use some easier approach
// and that could be enough for easy render library.
And read as much theory before. David Lively suggested nice articles. I don't say to make it in the same way that opengl does. It can be simplier for super simple library you are going to create, but opengl has very smart archicture, so consider keeping your path with it.
It is possible that i forgoten to include some crucial function, let me know in comments please.