libccd icon indicating copy to clipboard operation
libccd copied to clipboard

support function example for 3D convex mesh

Open xendian opened this issue 8 years ago • 6 comments

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.

xendian avatar Nov 14 '16 03:11 xendian

Hi Xendian,

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

Thanks

OM92 avatar Jan 12 '17 10:01 OM92

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

xendian avatar Jan 13 '17 21:01 xendian

You could find one here.

jslee02 avatar Jan 13 '17 21:01 jslee02

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.

xendian avatar Jan 13 '17 21:01 xendian

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.

jslee02 avatar Jan 13 '17 22:01 jslee02

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

xendian avatar Jan 13 '17 22:01 xendian