PDA

View Full Version : Draw edges / get coordinates



02-02-2004, 12:35 AM
I am trying to build a simple Preprocessor for finite element structures. One problem I have is to draw the edges of the elements. I am creating a list with GL_POLYGON, then a list with GL_LINES. When I display them together, the lines are somtimes partially hidden.

The next problem is to reference nodes or elements with the mouse. I can get the mouse position, but I am not able to get the screen coordinates of my vertices.

Does anybody know how to solve these problems?

dovkruger
02-02-2004, 05:32 AM
You didn't make it very clear, but I think you are trying to draw polygons, and then accentuate the edges in a different color.
If you want the lines to show reliably, you need to offset them slightly using something like:

glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(10,10);

maximian
02-02-2004, 09:31 AM
On this topic, does anybody know why enable line antialiasing cause visual problems with polygon offset. I seem to get this effect that when both are on, as I rotate the object, a portion of offset lines/wireframe is culled.

02-02-2004, 09:23 PM
Thanks for the hint with PolygonOffset, that's what I needed.

Can anybody help me with my second problem, how to pick nodes/elements from the screen?