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 › PVector tutorial, why does the sphere trail fade
Page Index Toggle Pages: 1
PVector tutorial, why does the sphere trail fade? (Read 880 times)
PVector tutorial, why does the sphere trail fade?
May 19th, 2010, 7:34am
 
Hello,

I am new to processing but not to programming.
I am looking over the PVector tutorial processing.org/learning/pvector/ (sorry my first post I can not put a link) and I do not understand why the old spheres fade over time.  Is this an inherent functionality of display() to fade all objects?  If so there must be a way to toggle it.

If I am not clear enough, the gray fill changes to a lighter fill and the black stroke disappears leaving only a light gray trail.  The code itself keeps no history of where the ball has been, so I know something else is causing this that is outside of the example.

Thanks,
Lucas
Re: PVector tutorial, why does the sphere trail fade?
Reply #1 - May 19th, 2010, 8:14am
 
The key relies on the lines:
 fill(255,10);
 rect(0,0,width,height);

It defines a fill value of white with lot of transparency, and draw a rectangle with this color, so it slightly white out the whole scene before drawing a new ball.
Re: PVector tutorial, why does the sphere trail fade?
Reply #2 - May 20th, 2010, 10:47am
 
thanks Smiley
Page Index Toggle Pages: 1