/** @see OpenGLTab#init() */ void init() { GL.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // fog color should be the same as the clear color // to look appropriate float[] fogColor = {1.0f, 1.0f, 1.0f, 1.0f}; GL.glFogfv(GL.GL_FOG_COLOR, fogColor); GL.glHint(GL.GL_FOG_HINT, GL.GL_DONT_CARE); GL.glFogf(GL.GL_FOG_START, 0); GL.glFogf(GL.GL_FOG_DENSITY, 0.0f); // set the end of the start distance; anything > 15 // units from the camera will be covered in fog GL.glFogf(GL.GL_FOG_END, 15); GL.glFogf(GL.GL_FOG_MODE, FOG_TYPES[0]); GL.glEnable(GL.GL_FOG); GL.glEnable(GL.GL_DEPTH_TEST); cubeListIndexBase = GL.glGenLists(1); createCube(); }