PDA

View Full Version : How can I wipe off an already display triangle ?



lglabc
09-10-2003, 06:10 PM
I draw a triangle,but when I draw a new triangle, it was covered by the old one.

I don't want to redraw the screen, just want to wipe off the old triangle or set it transparent. How can I do?

Thanks!

Mazy
09-10-2003, 10:49 PM
As soon as the triangle is drawn to screen its just a bunch of pixels so opengl have no information left about that triangles corners orh whats behind it. The solution is the one that you didnt want, clear and redraw everything except the triangle that you want to remove.

lglabc
09-11-2003, 04:18 PM
OK!
Thank you!
I will try other methods to solve the problem!

1234!
09-11-2003, 06:53 PM
As Mazy already told you:

The only 'reasonable' way to get rid of an already drawn triangle is to redraw the hole scene without that triangle.

Why do people always try to reinvent the wheel?

john
09-12-2003, 12:05 AM
it depends on your context, but you could also consider saving the buffer with the triangle not drawn, and copy it across and only redraw the triangle you want moved/deleted/transparent. This would be particularly beneficial if your scene is very expensive and you know a priori what triangle you want to move. Useful, for instance, when drawing a triangle sprite over a complicated scenes.