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?
[QUOTE=giello;1255003]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).
[/QUOTE]
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.
[QUOTE=GClements;1255013]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.[/QUOTE]
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?
Well, maybe the AMD implementation does tesselation internally. In general, GClements is right and if it works on AMD, they’re probably doing it wrong.
On another note, why exactly do you think you need to use POLYGON?