By the above code, i’m getting the border line. but the edges of the border line have inappropriate line caps. The lines end directly at the vertices. As a consequence with line widths > 1
there are visible gaps between the edges if the angle is <> 180 degrees.
Can you suggest me how to overcome this situation? is there any way to use square, circle or triangle cap like in Microsoft Windows GDI+.
One very dirty way would be to draw the polygon a bit enlarged, specifying the border color you want ( & disable for this the depth writes if necessary). Afterwards draw the polygon on top of it, at it’s normal size & color. & there you go, you have it!
hmmm, I have noticed this problem a long time ago, but it did not trouble me. Maybe you can draw vertices as points to make a kind of cap.
babis> I don’t think it is possible with your technique (or it is a bit complicated), you can do the same just drawing lines directly after drawing the mesh in fill mode and using a polygon offset. With GL_LINE_STIPPLE you can specify a line pattern.
thus the 4 verts of the quad are p0+nA,p0-nA,p1+nA,p1-nA,
this quad is only for a single line
but for your polygon
what u want to do is string multiple lines together, adding a triangle if the angle between the joins > 180degrees
well theyre sort of round, as theres no breaks in the lines, if u want perfect round corners then u will need to tesselate the triangle at the corner into lotsa triangles, eg like a GL_TRIANGLE_FAN
had a go at the rounded points, yes Zbuffer a lot more work (+ its still not 100%), i think ill stick to the single triangle
btw single triangle, if the lines arent that wide (+ the OPs ones wont be i think) youll hardly notice the difference + also texturing them is a lot simplier