Integration of OF with a physic engine sample

Hi all,

For all of you interested in how OF could be integrated with an existing open physics engine, here you have an example of it.

It is just a little demo of physic objects. It uses Flatland, a 2d physics library which internally uses ODE, one of the main open physic engines available… I don’t really like FlatLand code, it is not very clean, but it is an ok solution to have 2d physics using the power of ODE (in a short time).

Here you have the sample code……-Sample.rar

It was developed during the Interactivos? workshop held at MedialabMadrid (now called Medialab-Prado), where Zachary was one of the instructors… We used it in the project Magnéticos… in this link you can see an example of what you can get with this library and OF…


thanks julio - that’s great to see … can’t wait to play with flatland.

take care,

Hi, I’m trying to start up the example from above. I’ve installed the SDKs, etc… as per the instructions on the setup page, but I’m getting a strange error…

Error	1	fatal error LNK1104: cannot open file 'fmodvc.lib'	OF-FlatLand-ODE-PhysicsSample	  


what compiler, platform, version of OF ?


Hey, sorry, forgot the details…

Visual Studio 2005 8.05
Windows XP pro
0F 0.05 (I also tried with v. 0.04 when 5 didn’t work).


I bet it’s a problem with a super old version of OF so that vc project will likely not work across these versions of OF, primarily because we have switched versions of fmod, altered OF, etc. The OF scturcture changes enough that older project files will have errors like that. one simple solution if you can try downloading even older versions of OF. -

I’ll take a look today but I thought I’d make some notes about how to solve it in 0.05:

a) open the vcproj file for the example and take a look at any include paths or link paths that involve the extra libraries (such as ODE).

b) use an 0.05 project (in 0.05) and copy the source and data folders from this example in to that one.

you will get likely some include errors (if you are including other libs first). put the libs from the example somewhere (like addons/ODE) or somewhere else and add that include path until you dont get those errors. Then you will likely get link errors, you can then add the lib to link against.

be sure, when adding those include and link options you do it for both debug and release, otherwise if you switch targets it might get confusing.

I hope that helps - today I’ll give it a try —

ciao !

Hey Julio,

I am trying to do something similar but using box2d. I am curious about something that I can’t figure out. Did you use a vector field for the attractive/magnetic interaction part of this piece? I am having a hard time understanding how you got the people shapes to have gravity/attraction. It seems like Flatland doesn’t have this feature this is why I am guessing a vector field.