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