We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › getting rid of something previously drawn
Page Index Toggle Pages: 1
getting rid of something previously drawn (Read 496 times)
getting rid of something previously drawn
Nov 17th, 2008, 2:00pm
 
i need something to get rid of all that has been previously drawn every time, the draw() method is called.

is there any other possibility, than to draw a surface that covers the whole canvas? since i'm using 3d this gets really messy and is not satisfying...

isn't there anything that resets it all?

Re: getting rid of something previously drawn
Reply #1 - Nov 17th, 2008, 2:32pm
 
http://processing.org/reference/background_.html

??
F
Re: getting rid of something previously drawn
Reply #2 - Nov 17th, 2008, 2:33pm
 
I am not too sure about 3D, but at least in 2D, the usual way is to use background() at the start of draw() to erase everything and draw again.

I checked a couple of 3D examples and that's what they do too: draw() is cumulative (drawing on top of previous draw results) so if you animate something, you need to reset canvas on each frame.
Re: getting rid of something previously drawn
Reply #3 - Nov 17th, 2008, 2:52pm
 
that's it.
thank you guys!
Page Index Toggle Pages: 1