Hey Kai
Sorry for the late reply. Got mixed up in more than I wanted. But anyway, thanks! It works now! For those who are interested, here is my code:
float h = (float) Math.tan((fov / 180 * Math.PI) * 0.5f) * near;
float w = h * aspect;
float fl = -w;
float fr = w;
float fb = -h;
float ft = h;
float fn = near;
float ff = far;
float[] pMatrix = {
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1,
};
pMatrix[0] = 2 * fn / (fr - fl);
pMatrix[8] = (fr + fl) / (fr - fl);
pMatrix[5] = 2 * fn / (ft - fb);
pMatrix[9] = (ft + fb) / (ft - fb);
pMatrix[10] = -(ff + fn) / (ff - fn);
pMatrix[14] = -2 * ff * fn / (ff - fn);
pMatrix[11] = -1;
pMatrix[15] = 0;
FloatBuffer pMatrixBuffer = BufferUtils.createFloatBuffer(16);
pMatrixBuffer.put(pMatrix);
pMatrixBuffer.flip();
glLoadMatrix(pMatrixBuffer);