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 & HelpSyntax Questions › Changing values in the setup
Page Index Toggle Pages: 1
Changing values in the setup? (Read 179 times)
Changing values in the setup?
Nov 9th, 2008, 6:32pm
 
Hello everyone,

I've got a problem with traer.physic library...
I'm trying to dynamically change the attraction/repulsion value in the "makeAttraction" function (the averageRepulsion) :  

physics.makeAttraction(particlesA[i], particlesB[i], averageRepulsion, 50);

averageRepulsion is changed in the draw at each frame but the problem is that "makeAttraction" has to be called in the setup otherwise it slow down the applet alot... So averageRepulsion takes the value of the frame #1 and doesn't change.

Is there a way to fix the problem or i'm working on something impossible to do?

Thanks!
Johnney
Page Index Toggle Pages: 1