If I use instead of making the projection matrix then it appears that it works decently. (seems like one of the axes are backwards) If I use the projection matrix then nothing shows up.
glu.gluPerspective(zoom * fieldOfView, (float) GraphicsInfo.getWidth() / (float) GraphicsInfo.getHeight(), NEAR, FAR);
Vector viewPoint = MathUtils.add(position, viewDirection); Vector f = MathUtils.add(viewPoint, MathUtils.multiply(position, -1)); Vector fNormalized = MathUtils.normalize(f); Vector upNormalized = MathUtils.normalize(up); Vector s = MathUtils.crossProduct(fNormalized, upNormalized); Vector u = MathUtils.crossProduct(s, fNormalized); // setup orientation matrix orientation.matrix[0][0] = s.x; orientation.matrix[0][1] = s.y; orientation.matrix[0][2] = s.z; orientation.matrix[0][3] = 0; orientation.matrix[1][0] = u.x; orientation.matrix[1][1] = u.y; orientation.matrix[1][2] = u.z; orientation.matrix[1][3] = 0; orientation.matrix[2][0] = -f.x; orientation.matrix[2][1] = -f.y; orientation.matrix[2][2] = -f.z; orientation.matrix[2][3] = 0; orientation.matrix[3][0] = 0; orientation.matrix[3][1] = 0; orientation.matrix[3][2] = 0; orientation.matrix[3][3] = 1;
float fd = 1 / (MathUtils.tan(fieldOfView / 2)); projection.matrix[0][0] = fd / aspect; projection.matrix[0][1] = 0; projection.matrix[0][2] = 0; projection.matrix[0][3] = 0; projection.matrix[1][0] = 0; projection.matrix[1][1] = fd; projection.matrix[1][2] = 0; projection.matrix[1][3] = 0; projection.matrix[2][0] = 0; projection.matrix[2][1] = 0; projection.matrix[2][2] = (FAR + NEAR) / (FAR - NEAR); projection.matrix[2][3] = 1; projection.matrix[3][0] = 0; projection.matrix[3][1] = 0; projection.matrix[3][2] = (2 * FAR * NEAR) / (FAR - NEAR); projection.matrix[3][3] = 0; // projection.inverse(); generateProjectionBuffer();
// projection gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); gl.glMultMatrixf(projectionBuffer); // camera position matrix orientationBuffer.rewind(); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); // necessary since using multMatrix











