border for an irregular polygon
So I have this irregular shaped polygon. I draw it by filling the inside with triangles.
The outside I added a border by used GLLineLoop.
Now I want to draw second line (of a different color) inside. any ideas on how to do that?
Line1: ================
Line2: ----------------
Not
开发者_JAVA技巧Line1(width 3): ================
Line2(width 1): ----------------
Line1(widht 3): ================
Draw the outer line first with about double the width you want it to be, then the polygon, then the thinner inner line.
Draw the outside line first. Stack on top of that the polygon. Then draw on top of that the inner line. If the first line is wider than the last line, it will look like what you describe. A three pixel outside line, and a one pixel inside line will appear as two one pixel lines.
If this is a 3D item, and you need to show both sides, you'll have to stack these on both sides.
精彩评论