danfis / libccd

Library for collision detection between two convex shapes
Other
496 stars 110 forks source link

support function example for 3D convex mesh #27

Open xendian opened 7 years ago

xendian commented 7 years ago

Hi, I need to write a support function for convex meshes. Is there any sample code or implementation for this?. Can somebody give me some direction on this?. Thanks.

OM92 commented 7 years ago

Hi Xendian,

did you found out how to implement this? It would help me aswell.

Thanks

xendian commented 7 years ago

no not yet. is there anybody has any say on this?!!.

jslee02 commented 7 years ago

You could find one here.

xendian commented 7 years ago

I tried the same implementation..it didn't work out for my case. This doesn't consider the connectivity of the mesh. The reference triangle support function didn't work out either. That is reason, I asked sample code with convex mesh working.

jslee02 commented 7 years ago

I believe this code works. We don't need to consider the connectivity because we assume that the shape is convex. Checking all the vertices of a convex mesh would be enough to find the supporting point.

One corner case would be having multiple supporting vertices (when the dot products of the vertices and the are all the equal). In that case, we might want to set the supporting point in the middle of the vertices. I think extending the code for the corner case would be straightforward.

Edit: It would be helpful if you could post your code that doesn't work.

xendian commented 7 years ago

but the contact point differs based on the connectivity. You need to incorporate the connectivity, right?.