Weighted Particle Flocking?

Hi, not sure if my heading is the correct name for this technique but would be great to get anyone’s advice on what is going on here in the below image.

Am I right in assuming that the background image is providing some sort of weight for the particles to morph into? Has anyone here done anything like this in openFrameworks? Would be great to get any insights from the community into how something like this could be coded.



I don’t know the name either :slight_smile: But I guess you could do it relatively easy by picking random points inside your letters which you then pass to the particles. then you can interpolate the points to their destination on the letter and as soon as all have arrived repeat this with the next letter.


in https://github.com/fx-lange/imageSwarm I added a origin(=destination) to the particles (as underdoeg described). you can find the transformation between images and particles in the class DataSet. it was kind of a speed project - so the code is not very clean but the technik is very simple.

edit: but it’s not really a “weight”-technik. just setting the origin and switching the behavior between “free” and “go to origin”. perhaps to change weights instead would be smoother

Hey guys, thanks for the response. Very insightful. Fxlange, do you have a openFrameworks project that implements your image swarm code?

Thanks mate.

hey joshua,

I’m not allowed to upload the project itself but I’ll make a small example and commit it later.


awesome thanks mate. would be super helpful.


sorry for the delay.

I’m still working on it but it will take some more time.


No problem felix, let me know when you have something up. Cheers.

finally my example is up. sorry for the huge delay. had to finish my bachelor thesis first …


I hope the example is small enough and of any help.

there still remains much to clean up but I’m working on it. I also started to work on additional features like using font and silhouettes as input instead of binary images only.

great thanks mate. I tried compiling but no luck. Are you on OSX? did you have an Xcode project you might be able to share?

no sorry I’m on Ubuntu (with oF0071) and don’t have any mac.

should be possible to paste the src into a copy of any oF addon example xcode projects. I also removed some unnecessary dependencies, so you only have to include imageSwarm and ofxGui (perhaps ofxXmlSettings too) as addons.

I recorded a video of the contentSwarmExample (master branch).

let me know, if you get a working xcode project up. would be nice to have one on github.

Looks great man. Ok im putting this together but its complaining about ofxGui…

DO you have a version that works with 0071 by any chance? Thanks.