I am writing python script from Daniel Shiffman book “Nature of Code” for Processing.
Basically it is simple script that follows the rules of moving elements that attracts each other.
For instance 5 movers are always attracts each other.
The issue I have is that every time the script runs it becomes slower and slower.
Please firstly look at printscreens:
1 moment https://dl.dropboxusercontent.com/u/92943807/movers_printscreen1.png
100 moment https://dl.dropboxusercontent.com/u/92943807/movers_printscreen2.png
1000 moment https://dl.dropboxusercontent.com/u/92943807/movers_printscreen3.png
The script runs so that each time it adds position and velocity to previous ones.
Before I thought that I could simply clear “posList” and “velList” lists by function " del listname[:] "
It did not helped much and when I add counter from kangaroo so to see the whole process step by step the whole script is just too slow.
Could you please take a look at python script in order to help me?
Tryout by render to see the movement: