4
檢查我生成的圖像,但我想要做的是生成帶有邊框的矩形,並將背景顏色設置爲另一個。我怎樣才能做到這一點?
glRectf(top_left_x, top_left_y, bottom_right_x, bottom_right_y)?
if loop==0:
ratio = 0.10
glBegin(GL_QUADS)
while ratio <= 1.0:
width = window_width/2
height = window_height
long_length = width * ratio
short_length = height* (1.0 - ratio)
top_left_x = (width - long_length)/2.0
top_left_y = (height - window_height * (1.0-ratio)) /2
bottom_right_x = top_left_x + long_length
bottom_right_y = top_left_y + short_length
glColor(1.0,1.0,1.0,0.5)
glVertex3f(top_left_x, top_left_y, 0.0)
glVertex3f(top_left_x + long_length, top_left_y, 0.0)
glVertex3f(bottom_right_x,bottom_right_y, 0.0)
glVertex3f(bottom_right_x-long_length,bottom_right_y, 0.0)
ratio += 0.05
glEnd()
我改變了你的提供,但我得到完全相同的圖像。還有更多問題嗎? – user469652 2011-04-06 19:07:04
@ user469652:你還沒有發佈任何代碼。用那條線我不能告訴你更多。 – Heisenbug 2011-04-06 19:07:56
我粘貼了我的代碼,非常感謝您的幫助。 – user469652 2011-04-06 19:11:26