I am finally graduating to working with my own matrices in OpenGL and am having a bit of an issue setting up an orthographic projection. At the moment, I have a method which takes the left, right, top, and bottom and throws them into a matrix like this (from here):
2(right-left) 0 0 -right + (left * right) - left
0 2(top-bottom) 0 -top + (top * bottom) - bottom
0 0 -2(farVal-nearVal) -far + (far * near) - far
0 0 0 1
I then multiply that matrix by the projection matrix, and I get absolutely nothing that makes sense as an output. This leads me to believe I am 1). not using the proper orthographic matrix, 2). Not multiplying the orthographic matrix by the correct matrix, or 3). both.
I doubt it is 2 because whenever I worked with the deprecated functions, glOrtho was called when the current matrix was GL_PROJECTION. So how exactly do you calculate the orthographic matrix from the left, right, top, and bottom values?