PDA

View Full Version : draw and eras lines



perdue
08-20-2002, 11:36 PM
hello,
Is it possible to draw a line then erase it?
I tried with glReadipixels, glDrawPixels, but it doesn't work.
Thank you.

Bob
08-21-2002, 01:11 AM
To erase something, let it be a line, a car, or anything, just redraw the entire scene but skip whatever you want to erase. Sure it's possible to do it other ways, but this is probably the easiest.

The problem with erasing something is that the frame buffer is a 2D surface. If you remove a pixel, OpenGL doesn't know what was behind.

nexusone
08-21-2002, 05:23 AM
Yes, of course.

Just stop drawing the line when you redraw the scene.

http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by perdue:
hello,
Is it possible to draw a line then erase it?
I tried with glReadipixels, glDrawPixels, but it doesn't work.
Thank you.

killercow
08-21-2002, 09:03 AM
What you have to do if you don't want to redraw the screen without the line is make a copy of the stuff behind the line before you draw it, then when you want it gone just copy that over the line. but i'm not sure how to do this in openGL.

coredump
08-21-2002, 03:37 PM
Ctrl-C and Ctrl-V, right?

b