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 › particle physics for 100.000 particles
Page Index Toggle Pages: 1
particle physics for 100.000 particles (Read 2658 times)
particle physics for 100.000 particles
Sep 19th, 2009, 10:07am
 
I made a little sketch that scans the folder structure of a specific folder and renders it using particles. Each one is connected to its parent and they all repel each other, nothing more to it. It works really nice, I implemented different rendering modes, zoom, pan, manual particle positioning, etc.

Here are some screenshots.

The problem is that on more than 500-800 folders it becomes VERY slow. Do you think that it's possible to make it usable for around 100k-200k particles, probably ported to C++ or something faster

I can post the source if needed.

thx
Re: particle physics for 100.000 particles
Reply #1 - Sep 19th, 2009, 12:28pm
 
i am sure porting it to c++ would speed it up but if you wanna stay with processing. there was a similar thread about it some time ago:
http://processing.org/discourse/yabb2/num_1238682023.html

Re: particle physics for 100.000 particles
Reply #2 - Sep 20th, 2009, 12:17am
 
I am not sure that C++ will really be faster than carefully written Java... In such application, graphical rendering speed is also important (using OpenGL?). You also have to profile your application (perhaps using VisualVM if it is available on Apple platforms) to see what is really causing the slowdown. Sometime, in Java, it is due to excessive creation of short lived objects, making the garbage collector to have too much work. It is the case on the current JBox2D for example (creating objects that are just pairs of float to return results) and they saw great speed-up by taking alternative routes, less in Java spirit but effective.
Re: particle physics for 100.000 particles
Reply #3 - Sep 20th, 2009, 12:38am
 
Ok Smiley i have to admit i dont know anything about C++ i just thought it would be that way from what ive heard in the past. Still hopes the post i pointed to may help you as they solved a similar problem there.
Re: particle physics for 100.000 particles
Reply #4 - Sep 20th, 2009, 5:16pm
 
Thank you Cedric, I'll definitely have to try toxi's verlet library from that thread, seems much faster.

Unfortunately it's not the drawing that slows thing down, one of the rendering modes is noDrawing() which turns every visual feedback off to give full power to the simulation, it doesn't help a lot.

I don't need realtime speed, since it's for print, but if it works close to realtime with 10.000, it should be decent with 100.000 particles.

cheers
Re: particle physics for 100.000 particles
Reply #5 - Nov 24th, 2009, 9:21am
 
As I was browsing thru the internet and looking at various visualizations, I came across your screenshots and was particularly impressed with your visualization. It very much inspired me - and since I am planning on building up my own graph visualization in Processing also, I was wondering whether you like to share the source code with us, so that I could leverage your work while trying to build up my own force-directed graph layout for a large amount of particles visualization?

I would be thankful for any kind of help!

Many thanks in advance!
Page Index Toggle Pages: 1