OpenGL 多邊形的鏤空

2021-08-03 11:03:47 字數 682 閱讀 4013

1.凸多邊形的定義是多邊形的內角均小於180°。 2.

多邊形可以設定鏤空效果,使用glenable(gl_polygon_stipple)開啟鏤空模式,之後使用glpolygonstipple

設定鏤空基本圖案。

void   glpolygonstipple (const glubyte *mask);

mask是乙個指向32*32*8bit的矩形空間,這個矩形空間中前8位表示圖案最下方從左到右的8位畫素的顯示方式,1不鏤空,0鏤空顯示背景色。

可以用一幅大小為32*32畫素的圖案來定義多邊形鏤空的基本樣式單元。

製作方式為:

相關**:

[cpp]view plain

copy

print?

void

mydisplay(

void

)        

效果:

OpenGL 多邊形偏移

include gltools.h include glshadermanager.h include else define freeglut static include endif gluint list glint spinx 0 glint spiny 0 glfloat tdist 0....

OpenGL學習筆記四(多邊形)

在qt中的opengl模組中,使用opengl是比較簡單的,只需要在你建立的專案中新增 qopenglwidget 和qopenglfunctions就可以使用opengl基本上所有的功能。include include 在qt中使用opengl繪製點線也非常簡單。在開始繪製點線之前有幾個函式是必須...

OpenGL學習 點 直線 多邊形

上一課中,我們學習了如何繪製幾何圖形,但大家如果多寫幾個程式,就會發現其實還是有些鬱悶之處。例如 點太小,難以看清楚 直線也太細,不舒服 或者想畫虛線,但不知道方法只能用許多短直線,甚至用點組合而成。這些問題將在本課中被解決。下面就點 直線 多邊形分別討論。1 關於點 點的大小預設為1個畫素,但也可...