How to fill polygon with different color than boundary?

前端 未结 4 2310
暗喜
暗喜 2021-02-20 09:11

I need to draw a polygon that has the boundary lines with one color and fill the interior with another color. Is there an easy way to do this ? I currently draw two polygon

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-20 09:55

    I think you should see this answer: fill and outline

    first draw your triangle using glPolygonMode(GL_FRONT_AND_BACK,GL_FILL) and use your desired color. then draw the triangle again using glPolygonMode(GL_FRONT_AND_BACK,GL_LINE) using your outline color.

提交回复
热议问题