I have not used oblique / cavalier projection before, but the following should give you an idea of how to proceed:
Create a 4x4 shift matrix,
H(θ, Φ) = | 1, 0, -cot(θ), 0 | | 0, 1, -cot(Φ), 0 | | 0, 0, 1, 0 | | 0, 0, 0, 1 |
θ is the shift in X, Φ is the shift in Y, and Z is one.
( ref: slide 11 from http://www.cs.unm.edu/~angel/CS433/LECTURES/CS433_17.pdf )
Multiply this by your spelling projection,
| 2/(rl), 0, 0, -(r+l)/(rl) | | 0, 2/(tb), 0, -(t+b)/(tb) | | 0, 0, 2/(fn), -(f+n)/(fn) | | 0, 0, 0, 1 |
(described left, right, bottom, top, closer and far)
(ref: http://en.wikipedia.org/wiki/Orthographic_projection_%28geometry%29 )
OpenGL then allows you to load this matrix directly (as an array of 16 floats) using the glLoadMatrixf () function:
GLfloat proj[16] = { ... }; glMatrixMode(GL_PROJECTION);
For a deeper understanding of how viewing and transformations work in OpenGL, I would call you OpenGL Chapter 3 Red Book . There they use glOrtho () to create and apply spelling projection.
Edit:
As datenwolf points out, keep in mind that matrix elements in OpenGL are listed in the main column order.