# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: HACD Problems (w/ pics)Posted: Sat May 26, 2012 11:06 pm

Joined: Mon Mar 05, 2012 11:39 pm
Posts: 9
Hey all,

Sorry to trouble you all with what is hopefully just me doing something silly. When I feed a trimesh into into Bullet's HACD processor (code below) I get the following meshes in and out.

Clearly, something is wrong, but I am not sure how to go about diagnosing the problem. I'm using Bullet via BulletSharp. Anyone seen anything like this?

1) A simple cube turns into a triangle. High Res: http://i.imgur.com/TInxf.png

2) The classic table example. High Res: http://i.imgur.com/ld6Yv.png

3) A more pronounced example. High Res: http://i.imgur.com/rTUgf.png

Code:
// Create the HACD processor.
var pProcessor = new Hacd();

// Set the data.
pProcessor.SetPoints(tVertices);
pProcessor.SetTriangles(tIndices);

// Other settings.
pProcessor.CompacityWeight = 0.1;
pProcessor.VolumeWeight = 0.0;
pProcessor.NClusters = 2;

pProcessor.VerticesPerConvexHull = 100;
pProcessor.Concavity = 100;

// Compute the mesh.
pProcessor.Compute();

// Save the mesh.
pProcessor.Save("/assets/myasset.wrl", false);

The variables tVertices and tIndices contain the vertex and index buffer respectively.

Any ideas? I'm at a loss!

Cheers,

John

Top

 Post subject: Re: HACD Problems (w/ pics)Posted: Sun May 27, 2012 7:04 am

Joined: Tue Dec 25, 2007 1:06 pm
Posts: 317
Have you tried playing around with parameters ? Something like this:
Code:
pProcessor.NClusters = 20;
pProcessor.Concavity = 10;

Top

 Post subject: Re: HACD Problems (w/ pics)Posted: Sun May 27, 2012 11:34 am

Joined: Mon Mar 05, 2012 11:39 pm
Posts: 9
Heya - yea, I spent last night trying different combinations on different models. I'm guessing that my vertex / index format must be wrong somehow.

Are there any special conditions or formats to be aware of when using SetPoints and SetTriangles? It looks like its not getting all the faces right or something like that.

Here are those parameters: High Res: http://i.imgur.com/N7Ubg.png

Top

 Post subject: Re: HACD Problems (w/ pics)Posted: Fri Jun 01, 2012 12:03 pm

Joined: Tue Dec 25, 2007 1:06 pm
Posts: 317
The mesh you're passing to HACD doesn't look correct indeed... maybe you're not passing it the right way...

If you can export the mesh in .obj or .off format and you're using windows, you can use the prebuilt converter I've made some time ago (here: http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=17&t=7159), and play around with the configuration file to get the best decomposition parameters.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities