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 › DLA - Diffusion-limited aggregation Help
Page Index Toggle Pages: 1
DLA - Diffusion-limited aggregation Help (Read 414 times)
DLA - Diffusion-limited aggregation Help
Dec 5th, 2008, 11:42pm
 
Hi, i hope i can find some help here...
I started to work on a project where i use DLA ( http://en.wikipedia.org/wiki/Diffusion-limited_aggregation ) do generate some graphics... I found a great example of it here : http://stungeye.com/processing/1007/

but i now have some problems with it and i guess it would be useful to reprogramm it from scratch.

The example uses loadPixels() to check if the pixel is white or not and if it is, the particle freezes.
The probleme here is that it is not really flexible for what i need. I can not easily change the particle into something else, i can not use OpenGL, i can not scale it, can not use different colours in this example...

I guess what i need is more like a collision detection...
But i have no idea how to start.

So what i basicly want to do is to seed different points from where the DLAs begins do grow.
As i want to grow more then just one "cloud" i guess i need an array of arrays to store all the particels...

Does anybody have a good example or know a good way to start?

Thank you!

Re: DLA - Diffusion-limited aggregation Help
Reply #1 - Dec 10th, 2008, 11:04am
 
Hi Cedric,

i would suggest that instead of just drawing the white pixels to the canvas and using loadPixels to check the colorvalue afterwards, you should try to represent the cristal-pixels and their position in a separate datastructure.
Since you already use an ArrayList of your class Particle it might be a good start to Store your christalized pixels and their position in a similar way. Then instead of using the pixels[] Array to check whether one of the band pixels has a neighbour you would go through the List of christalized Pixels and compare their positions.

Cheers,
Paul
Page Index Toggle Pages: 1