Loading...
Logo
Processing Forum
Hi

Im developing an tracking app based on kinect, the program does those things rigth:

      - obtain a blob with opencv
      - delaunay that blob using poly2tri



But now i want to put those triangles inside a pbox2d body and i always get assertionerror creating the shape.

How can i draw a complex body created from triangles in pbox2 ?????

I dont know if the delaunay that i get using poly2tri is usable directly in box2d (vertex order, minimun size,...)

In openframeworks there are methods to do this easy but i can not seems to be capable of doing in processing.


Please, give me some light on that !!!!!!!!!!!!!!!!!




Best regards
Natxo Pedreira Gonzalez

Replies(5)

can you share the code. I am creating the similar app using the blobscanner and kinect with pbox2d. 
here the link of my prob  here
I can try to find the code but that was long time ago, i moved to openframewoks.

Yo want that the particles interact with the user shape no?

In of you can take the blob and calculate with delaunay the triangles to make the box2d body, so i was looking to do the same in processing

Instead you can try to make a path with the contour finder in box2d not a full body. so you dont need triangulation

Hope that you understand
Yes I want the particles to interact with the user contour shape.

Thanks for the suggestion but I didn't understand  "   you can try to make a path with the contour finder in box2d not a full body. so you dont need triangulation" comments. can you suggest any tutorial or method to get box2d interaction with contour in processing ( is it possible in processing anyway ? or shall i try it in openFrameworks never tried though)


hey no problem, my english is not good.

I will try to explain better:

You need to get the shape of the user and transform that in a box2d object, i know two ways to do that:

- METHOD ONE
use the blob contour as an array of points to build a custom box2d shape

- METHOD TWO
using triangulation, so you have first to get the array of points but in this case you have to triangulate the points (delaunay) and insert the box2d body as a bunch of triangles.


The first method is the easy way, i dont remember the name but there is a processing box2d wrapper that comes with a method to build complex shapes with an array of points.

In each loop of the program you have to erase the contour and make that again.

Sorry but i dont know of any tutorial about.


Hope that helps


Thanks for the help but I am still stuck on how to convert blobs into box2d bodies. Do you have any code for this. Please share it.