Article on flocking with openframeworks

At http://openframeworks.info/prog-tech/flocking/28 you can find an article
on flocking using Graig Reynolds descriptions. At the bottom of the article you can find the
source code.

It’s still a draft version. If you find something I can improve please tell me.

Roxlu
http://www.roxlu.com
http://www.openframeworks.info

nice one!! :wink:

Hello ruxlu,

Thanks for the article and the source attached.

It may have something to do with my entry level skills but…
I have tried to compile the example and the compiler threw an error in the TestApp.cpp file.

"error: no matching function for call to ‘ofxSimpleGuiToo::addSlider(const char [13], float*, float, float, float)’’

The implementation seems correct to me.

here is what my ofxSimpleGuiToo.cpp looks like:

  
  
  
ofxSimpleGuiSliderInt &ofxSimpleGuiToo::addSlider(string name, int &value, int min, int max) {  
	return pages[currentPage]->addSlider(name, value, min, max);  
}  
  
ofxSimpleGuiSliderFloat &ofxSimpleGuiToo::addSlider(string name, float &value, float min, float max, float smoothing) {  
	return pages[currentPage]->addSlider(name, value, min, max, smoothing);  
}  
  

any ideas?

Hi tezzutezzu,

Oh, you need to install/download the ofxSimpleGuiToo addon; see
this page: http://www.openframeworks.cc/addons/contributed

Roxlu

Hello Ruxlu. I did it.

The ofxSimpleGuiToo version is the latest from the SVN repository

This is how my folder tree looks like

edit: this is the other error that I’m getting:

cp: /Developer/of_preRelease_v0.06_xcode_FAT/apps/dan_app/flocking3/flocking3-debug.app/Contents/MacOS/libfmodex.dylib: No such file or directory

Hi roxlu,

Did you get this glow effect by using a transparent PNG?

Rick

Hi Companje,

Yep, I created a somewhat orange, alpha transparent and blurred image with Photoshop and used alpha blending to create this effect. You could also google on “openGL bloom” effect which is kind of similar; though this is way easier :wink:

Roxlu

[quote author=“tezzutezzu”]Hello Ruxlu. I did it.

The ofxSimpleGuiToo version is the latest from the SVN repository

This is how my folder tree looks like

edit: this is the other error that I’m getting:

cp: /Developer/of_preRelease_v0.06_xcode_FAT/apps/dan_app/flocking3/flocking3-debug.app/Contents/MacOS/libfmodex.dylib: No such file or directory[/quote]

I have the same problem as you, did you solve it?

Found the answer somewhere else…

In testApp.cpp
Remove the ‘&’ in “&slider_vals…” to get rid of the error. Should be:

gui.addSlider(“boid.max_vel”, slider_vals[“boid.max_vel”],0.1f, 40.0f, 0.1f);

hi roxlu!

tried this on 64bit linux. compiles well, but when i start it i get the following error:

  
OF_ERROR: Error loading xmlFilename: _settings.xml  

i see the the window with the balls, but nothing is moving.

did i miss something?

This isn’t a problem. I think it just means you don’t have any saved settings file. try pushing space bar to get the GUI and increase the maximum speed from 0. Then they should start moving.

thanks, you’re right.

i tried this and noticed, that i ran in the “linux” problem mentioned here: http://forum.openframeworks.cc/t/ofxmsafluid-and-ofxsimpleguitoo-examples-fixed/2619/17 and now it works.

Thanks for the flocking example! works nice.

Hi,

I am sorry for digging up a very old topic. Does anyone have an archived source code of this example? :slight_smile:

Since the links are dead by now I was able to retrieve an archived copy of the article,

http://web.archive.org/web/20100710055446/http://www.openframeworks.info/prog-tech/flocking/28

Would be great if we can re-share the source code.

Thanks!