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 3 of 3

Thread: Example of 2D (or 3D) complex polygon fill

  1. #1
    Junior Member Newbie
    Join Date
    May 2006
    Location
    Auburn, WA
    Posts
    1

    Example of 2D (or 3D) complex polygon fill

    Am just starting out using OpenGL and need a good example of a complex polygon fill (one with may sides). Am at present drawing maps with such features as cities, counties, and lakes (having many sided polgons). Polygons at present don't have interior exclusion areas.

  2. #2
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,119

    Re: Example of 2D (or 3D) complex polygon fill

    Your biggest problem will be nonconvex polygons. I googled for:
    GL_POLYGON nonconvex
    to find an usefull article and I found this pdf for beginning:
    http://bit.csc.lsu.edu/~karki/SV-06/SV_Drawing.pdf
    It doesn't describe how to deal with nonconvex polygons, but it explains drawing polygons, line stipple and more things that can be usefull for maps.
    Also - interior exclusion areas can be simply implemented by drawing a polygon with background color.
    If you run into problems with nonconvex polygons, then perhaps we can talk about it. Righ now I'm leaving it up to you.

    Best regards

  3. #3
    Junior Member Newbie
    Join Date
    May 2006
    Posts
    3

    Re: Example of 2D (or 3D) complex polygon fill

    You can use the GLU tesselator. Look gluTessBeginPolygon, gluTessCallback, ...

Posting Permissions

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