Open GL: dessine des rectangles avec des bordures?
Vérifiez l'image que j'ai produite, mais ce que je veux faire est de produire ces rectangles avec des bordures, et définir la couleur de fond à l'autre. Comment puis je faire ça?
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()
J'ai changé comme ce que vous avez fourni, mais j'ai exactement la même image. D'autres problèmes? – user469652
@ user469652: vous n'avez publié aucun code. Avec cette seule ligne, je ne peux pas vous en dire plus. – Heisenbug
J'ai collé mon code, j'apprécie vraiment votre aide. – user469652