HACD ConvexDecompositionDemo - Problem with own .obj file

Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

HACD ConvexDecompositionDemo - Problem with own .obj file

Post by Gickl »

Hi,

when i use the ConvexDecompositionDemo with the included file.obj the decomposition works fine. the left side of the picture shows the resultant btCompoundShape consisting of btConvexHullShapes.

but when i want to decompose an own .obj file that i generated with "osgconv model.osg model.obj" it results in curious shapes (see picture on the right side). the small picture shows the original model. 50 clusters are detected but i think maximal 8 would be enough.

does someone have an idea what causes these curious decomposition? is it a problem of the conversion by osgconv?

best regards
Gickl
You do not have the required permissions to view the files attached to this post.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: HACD ConvexDecompositionDemo - Problem with own .obj fil

Post by Basroil »

Are those steps or just a texture?
Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

Re: HACD ConvexDecompositionDemo - Problem with own .obj fil

Post by Gickl »

it's just texture
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: HACD ConvexDecompositionDemo - Problem with own .obj fil

Post by Basroil »

If that was the actual model I would have said there's your 50 part problem! :wink:

From the looks of it, the internal vertices are being mostly ignored, and new surfaces are in relative proximity where you would expect them if the external direction kept switching. How does the obj file look when directly used without decomposition? Perhaps you can also test by making an equivalent obj file in blender or something then seeing if that also fails. Does sound like something is corrupting the obj and messing with surface normals in the process, but hard to know for sure without testing each part right?
Gickl
Posts: 33
Joined: Tue Jun 05, 2012 8:43 am

Re: HACD ConvexDecompositionDemo - Problem with own .obj fil

Post by Gickl »

i found out, that there was a problem with the .obj files respectively the one above. for example when i convert the box shown in the first picture with osgconv the result displayed with osgviewer looks like shown on the right side of the picture.

it may be a problem of the faces. so i exported some .obj files with the objExporter of Sketchup and used the front faces. when i display these models they look correct (see the second picture for example). the result of the decomposition looks almost correct. but there are some "new" edges (shown in the middle) and some strange new parts build of vertices where actually no vertices are...i don't know what causes these "new" points and edges...
You do not have the required permissions to view the files attached to this post.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: HACD ConvexDecompositionDemo - Problem with own .obj fil

Post by Basroil »

Without knowing the internals of osgconv it's going to be hard finding a solution to that side of the problem, but does seem like the conversion from vertices to triangles isn't being done properly and then propagates through. Got no clue as to why convex decomp would do the second thing though, haven't really used it enough to see anything quite like that!