KAPSID – Neko's Blog

Form Follows Function

ContactListener works

Hiya,

have managed to get the contact listener working, which i have gotten through ascrobin’s forum post at the openframeworks.cc forum.

Will just have to fix a memory leak that I have created (fps upper left corner) and can then start fine tuning animations.

Cheers

Gabor

Filed under: Software

ContourFinder update

Hiya,

after having a break for a week I desperately needed to figure out what caused my little OpenFrameworks project to run slowly. I knew that it had to be the way I was generating those words falling into the screen. I was (greenhorn) loading ofTrueTypeFont repetitively inside my draw() method, which of course strained the performance heavily as soon as there were more than three words on the stage. Since I’m very new to C++ and I am still not used to the whole pointer reference thing it took me some time to figure out how to load a font once and then refer to that instance rather than loading that font in repetitively at 60fps. But now things look way different. The video shows the improvement, which runs between 20fps-40fps while having my screen recorder software running. As soon as i close that program the performance goes back up to 40-60fps. Thanks go out to Josttie at Openframeworks.cc

Filed under: Software

ofxOpenCV ContourFinder & ofxBox2D

Hi there. Very little I know about C++ and OpenFrameworks. But I have decided to still go for it. At least now I got started. The learning curve is pretty flat for me and it will probably take a bit of time to become confident in writing C++ code. It’s a different game to AS3.0. Flash developers are spoiled. So anyways…I have tried to pull that thing off all on my own using a few forum hints C++ OF, ofxOpenCV and Box2D physics engine but ran into some issues with defining the contour that is being drawn as a physics body. Thankfully, I tripped over this forum thread in which 2 approaches have been shown by “Smallfly” & “Johnavila2”. Finally “Vanderlin” came up with a solution using the wrapper lib ofxBox2D and posted his code to download. It utilizes another class that simplifies the contour found by ofxOpenCV and turns it into a Box2D edge. So thanks go out to you guys. Obviously it needs quite some tweaking.

But it works. 😉

Cheers

Gabor

Filed under: Software