Do the "Making VectorFields from images" wiki example work?

Hello!

I’m an absolute newbie, coming from the Processing side of it. I’m trying to get the VectorFields example from the wiki -> guides page to work, but I have some problems.

http://wiki.openframeworks.cc/index.php?title=Making-VectorFields-from-images

The error seems to be that I do not have the right library that works with this example. In the source code it includes “ofVec2f.h”, but I think this might not be the right one anymore? So, does anyone have a hint of what I should do now to get this example working? If I do get it to work I will edit the wiki so it is up to date, unless someone more fluent than me would like to do that :slight_smile:

Cheers!

Hi

Yes, you’re right about the library thing. ofVec2f.h is part of the ofxVectorMath Addon, which is shipped with the FAT openframeworks package, downloadable here: http://www.openframeworks.cc/download You have to include these files in your project and point the header search path to it. The process how to do that depends on your IDE. What are you developing with? On Apple’s XCode you simply have to drag’n’drop the ofxVectorMath Folder to your project or follow this video: http://www.openframeworks.cc/addons/installing

cheers ph

Ah, thanks! Ok, so I tried to put it inside the src folder inside the project, and I renamed the include directive to be ofxVec2.h instead of ofVec2.h but still no luck. Is it maybe more that needs to be done, or am I putting it in the wrong place? And, yes, I’m on xcode … :slight_smile:

I got it to work now! I get 4 warnings about “different visibility” but I’m not sure how to fix that. And it seems to work fine without it as well.

I dragged the required library (ofxVec2f.h) inside my source folder (not sure if that is the best place, but I had it working from there at least), then I had to update all the instances of ofVec2f in the code to ofxVec2f, and then it worked!

Thanks for your help! Awesome to have this possibility of working with such a low-level language (relatively) in such a simple manner :wink:

I’m glad it worked. And yes, according to my benchmarks around ten times faster :wink: