开发者

border for an irregular polygon

开发者 https://www.devze.com 2022-12-11 05:58 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消