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

Thread: GL_POLYGON and QT: working after update.. why!??

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    6

    GL_POLYGON and QT: working after update.. why!??

    Hi guys,

    I'm using opengl with Qt and I'm working on shapefiles.

    Basically, I was taking the shapefile and building the map with OpengGl drawing points, lines and polygons depending on the data retrieved from the shapefile.

    The problem was with the GL_POLYGON: it added lines that they shouldn't be there to close the polygon (I think).

    In another computer, now I have just updated all the packages and it seems that this problem isn't present anymore.

    Have you idea of what happened? chich package is the responsible of this behaviour?

    Thank you in advance!

    Ps I'm on OpenSuse 12.2!

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by giello View Post
    Basically, I was taking the shapefile and building the map with OpengGl drawing points, lines and polygons depending on the data retrieved from the shapefile.

    The problem was with the GL_POLYGON: it added lines that they shouldn't be there to close the polygon (I think).
    You are aware that GL_POLYGON is limited to convex polygons, right? If you need to draw non-convex polygons, you need to either tessellate them into a set of convex polygons (e.g. using the GLU tessellation routines) or use stencilling.

    If you try to draw a non-convex polygon with a single GL_POLYGON call, the results are undefined, and likely to vary according to the hardware and driver.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    6
    Quote Originally Posted by GClements View Post
    You are aware that GL_POLYGON is limited to convex polygons, right? If you need to draw non-convex polygons, you need to either tessellate them into a set of convex polygons (e.g. using the GLU tessellation routines) or use stencilling.

    If you try to draw a non-convex polygon with a single GL_POLYGON call, the results are undefined, and likely to vary according to the hardware and driver.


    Ok, I understand. Thank you for your suggestions.

    The fact is that in the other computer it works great.. very strange...


    Which solution do you suggest to use? is there anything already ready in OpenGL?

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    6
    wouldn't it possible that OpenGl internal implementation changed in a way to draw concave polygons?

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    What hardware configs are you testing on?

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    6
    the one in which tessellation is ok uses an amd FirePro while the other it's a GeForce, I have to check for the model number

  7. #7
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by giello View Post
    Which solution do you suggest to use? is there anything already ready in OpenGL?
    Assuming that the data is static, use the GLU tessellation functions and store the tessellated data.

  8. #8
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    6
    Ok, thank you. I think I'll tessellate each polygon on the fly

Posting Permissions

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