I need to dynamically adjust the near and far z clipping values while my game is running, but how?
I am calling gluPerspective and glFrustum, but only the first initial call seems to have any effect?
You are probably in the modelview (i.e. rendering) matrix when you call those functions. You need to go back into the projection matrix to re-adjust the viewport.
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
// reset your view here
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
// back to rendering!
Quote from: "djork"You are probably in the modelview (i.e. rendering) matrix when you call those functions. You need to go back into the projection matrix to re-adjust the viewport.
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
// reset your view here
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
// back to rendering!
Thanks a lot :)