Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Polygon doesn't fill up properly

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2005
    Posts
    3

    Polygon doesn't fill up properly

    Hey

    i'm new to OpenGL..and i'm facing this problem.

    on the Y-axis, instead of a surface, i get a bee-hive type of structure..
    eg.
    the object looks fine from the other axis though

    my source code

    please advise.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: Polygon doesn't fill up properly

    You don't ask for a depth buffer when initializing the window.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2005
    Posts
    3

    Re: Polygon doesn't fill up properly

    so, instead of putting it in the init part, where should it be done? before each draw?

  4. #4
    Guest

    Re: Polygon doesn't fill up properly

    you are doing pretty cool stuff, for beeing new to openGL. What book do you use?

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: Polygon doesn't fill up properly

    Add GL_DEPTH in glutInitDisplayMode. Just like you ask for an RGB color buffer, and just like you ask for a double buffer, you must ask for a depth buffer aswell.

    Since you don't ask for the depth buffer, you don't get one. And if you don't have a depth buffer, depth testing doesn't work.

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2005
    Posts
    3

    Re: Polygon doesn't fill up properly

    Managed to figure out the problem already. It was the way i plotted the points for the polygon mesh.

    the old way i did, plotted the points from the inside to outer surface resulting in the beehive..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •