Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Does anyone know tools to generate convex collision geometry from given 3D model?

For example, UDK's Static Mesh Editor can do this; Valve instead recommends to use smoothing in 3D editor.

Desired features:

  1. The tool could convert concave geometry into convex shape automatically and remove unnecessary model data.
  2. Could allow us to specify number of vertices/triangles in generated collision shape.
  3. Could export that shape to some interchange file format (like COLLADA or FDX).

Does that tool exist? (it even can be commercial, not free, but could be obtained separately, without particular engine/SDK/bundle...)

share|improve this question
2  
Calculating a bounding hull from a point cloud is already covered by well-known algorithms, as-is finding the best-fitting AABB or sphere. You should ask how to do something, not what does something, as "what technology to use" questions are considered off-topic here. –  Sean Middleditch Jun 5 '13 at 21:34
    
And where to ask that questions? –  Alf Jun 6 '13 at 5:57
    
no idea; I don't make the rules. But really, understanding the techniques will better help you find and evaluate existing milddleware anyway; you will be so much stronger of a developer by learning how to do something than you will be by simply being given a list of software, even if you end up buying a license to such software in the end. –  Sean Middleditch Jun 6 '13 at 9:21
    
That's right (agreed). –  Alf Jun 6 '13 at 10:53

2 Answers 2

up vote 5 down vote accepted

I suggest automatically generating, and maybe caching, the convex collision meshes instead of creating them by an external tool. However, I am not sure which of the following ideas is what you want.

Do you want to end up with a single convex shape for a single model? That would be a convex hull around all vertices. Of course that simplification results in not that accurate collisions but on the other hand it is very fast compute them. Moreover, you have only one physics body per object which is faster than the alternative below.

original modelconvex hull of the model

Images are from http://cgtools.net/treatments_convex_hull.html.

Do you want to end up with several convex shapes for a single model? Then convex decomposition is what you want. For example Bullet Physics has an algorithm called HACD built in to perform convex decomposition. There is also a standalone version you could integrate in your own application. Furthermore, the algorithms allows you to specify the amount of detail and number of clusters in the result.

convex decomposition performed by HACD

This screenshot is from the algorithm author's blog linked above.

share|improve this answer
    
Can't vote up your answer but it`s definitely what I was looking for. –  Alf Jun 6 '13 at 5:58

V-HACD V2.0 provides better decomposition results than HACD. Check it out! http://kmamou.blogspot.ca/2014/11/v-hacd-v20-is-here.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.