Search code examples
javaopengl3dswtclipping

Strange Clipping Issue in OpenGL


I am very very new to OpenGL, so please bear with me. :) I'm working through NeHe's OpenGL tutorials, and I have developed my own version of Lesson 5, in which you rotate a 3D shape around the origin. I'm not sure what I did wrong, I copied the code nearly line-for-line, but I'm seeing strange overlaps in my surfaces.

Does anyone have any suggestions as to what would cause such an issue?


Solution

  • Wow, completely fixed it with one line:

    gl.glEnable(GL.GL_CULL_FACE);
    

    I have no idea what it does, but it wasn't mentioned in any tutorials I used, but my demo works perfectly now. Off to Google to figure out what that did. :D