The interesting thing is how I apply objects from camera to box2D.
It is made not by inserting object’s contours into box2D world directly,
but changing positions of box2D objects and applying forces.
The interesting thing is how I apply objects from camera to box2D.
It is made not by inserting object’s contours into box2D world directly,
but changing positions of box2D objects and applying forces.
I’m currently working on the same issue and facing some problems making the contour (a box2d linestrip in my case) really interactive, i.e. my contour can’t push other objects, yet.
I understand that you can’t put a new linestrip from the opencv blob every frame in order to solve that problem.
So what do you mean exactly by saying you change the positions of box2d objects and apply forces?
Your help is much appreciated. I’m stuck here for days now.
I’m analyzing relative position of the balls and the opencv contours:
when the ball is inside the contour, I’m adding the force to the ball in the shortest direction to push it out from the contour. (Currently I’m not managing ball rotation - so you can see some artifacts on this.)
Wow!
I’ve been trying to do this for so long. Could I ask you for a bit more information? how did you managed to use contour filtering and turn it into a box2d object that can transfer energy onto other box2d objects?
I’ve used the Delaunay method that is somewhere here in this forum but your method seems much better!
=D
Anyway you could release your Diamond Alchemy and/or Basketball codes in either Mac version, or in Windows code::blocks version? I am not too familiar with Visual Studio. Thanks.
We published ofxKuBox2d addon which combines Box2D and binary masks (from depth or web camera).
It implements the technique of working with Box2D used in Diamonds Alchemy.