Home Technical Talk

Ratcliff's approximate convex decomposition

polycounter lvl 19
Offline / Send Message
adam polycounter lvl 19
http://www.codesuppository.blogspot.com/

Scroll down about 1/5 the way to where he talks about "Approximate Convex Decomposition". I'm curious if anyone has written a plug-in for Max/Maya that uses this specific code. I made a post not to long ago asking about a plug-in that'll take a mesh and convert it to a bunch of convex shapes. His code base does this, it just needs implementation.

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    Does reactor do this? Maybe it's only doing it internally though, never tested it.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    http://www.melax.com/3dsmax/agghull/

    probably not as good as the one you mentioned, as it says its still experimental, but maybe it helps to play around.

    but thanks for your link anyway, cool stuff over there =)

    edit: btw he wrote "My next little project is going to be to put the ConvexDecomposition library into a 3D Studio Max plug-in. As I become more comfortable programming in the Max SDK I hope to add more seamless support between CreateDynamics + PhysXViewer + NxuStream + COLLADA + 3D Studio Max."

    so maybe we just wait for that
  • JohnRatcliff
    Options
    Offline / Send Message
    I'm working on a plug-in. I have the basic code working but I have to add a user interface.

    I am only just now learning how to program 3ds max plug-ins so I have kind of a steep learning curve to get over.

    I will try to add at least a basic user interface and update it early this week.

    I'm looking forward to testing and feedback. The tool works pretty well. It has been integrated into the latest Unreal editor and the feedback I have received from the artists is that they are very thrilled with the results.

    Thanks,

    John
  • JohnRatcliff
    Options
    Offline / Send Message
    I had an hour to work on the plug-in and got a basic user interface in it. It was built against 3d Studio Max 8.

    You can find the plug-in (with source code) on my coding website. Please read the post that goes with it. It explains what more needs to be done to the plug-in to be really useful as a production tool.

    http://codesuppository.blogspot.com/
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    hello John, thanks for coming here and thanks for the tool =)

    btw, just a hint from an unexperienced maxsdk ui coder, it's much easier and faster to do the ui work in maxscript, and control the plugin via functionpublishing.

    I'll try to compile for max5 and 6 (6compiled should work for all) tomorrow.
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    Hey John, thanks for the e-mails and thanks for doing this plug-in. I'll try it out on Max 7 in the next few days and get back to you. Really excited to get this going and integrated in to my work flow.

    Thanks again!

    CrazyButcher: You're doing 5 and 6... would it be much to ask to throw 7 in there as well? I know nothing about programming/max script and all that whiz-bang magic.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    a 6 compiled plugin should work under 7 and 8 too, hence 5 & 6 should be sufficient for all

    http://crazybutcher.cottages.polycount.com/wip/meshfw_plugins.zip

    by the way John, you delete the source object, is that wanted ?
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    I'm gettting this when I go to load the .dlu:
    meshframeworkerror.jpg

    I changed it from _6up to see if it was a name error. I'm not familiar with Max errors, plug-in creation, or the like so any insight CrazyButcher would be great.

    Thanks again John!
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    I tested the 5 version on 5.1 and the 6up on 8, dont know why it shouldnt work for 6 and 7 (sorry cant test those).
    is msvcr71.dll in your max or system directory ?
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    Yeah. A co-worker of mine tested it as well and got the same error. Max 8 worked fine.
  • JohnRatcliff
    Options
    Offline / Send Message
    Ok, I just rebuilt it for the Max 6 SDK and uploaded it to my site. I also changed it so that it doesn't delete the original object by default. There is a checkbox so you can have it delete the selected object if you want it to.

    The revised file is on my site at the previous link:

    http://www.codesuppository.blogspot.com


    It also shows a 'busy cursor' while it is working and color codes the results.

    I *tried* to get it to put all of the output into a single group but, for some reason unknown to me, it didn't work. If anyone can explain what I did wrong I would appreciate it.

    Let me know if it runs on Max6 and Max7. I would expect that it should.

    The easiest way to test what the tool does is to simply make a torus and then try fitting against it with multiple recursion depths.

    To clarify the purpose of this tool, it is to produce efficient and accurate physics collision models from an arbitrary input mesh.

    Physics engines operate generally on collections of boxes, spheres, capsules, and convex hulls. Right now this tool just builds convex hulls. The hulls are put together into a single collision representation called a 'compound shape'.

    One of the things I hope to work on soon is auto-generated pre-fracture so that getting a version of an object, like a chair or table, that can be broken into many pieces is a one-click operation.

    I appreciate any input from plug-in gurus.

    Finally, one comment I recieved (either in this thread or by email) was that I should do my UI in max-script. That would probably be an option if I knew how to program maxscript. However, I already know how to do dialog box programming and that is easy for me. Also, I really don't like having to install scripts in addition to a DLL. Simply installing a DLL only seems a lot cleaner.

    Thanks,

    John
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    Hey John, it's workign great. I noticed that on a low decomp setting it's creating 2 hull's.. on higher ones it's creating just 1. Anyway, this is great man and will speed up my workflow tremendously.
  • JohnRatcliff
    Options
    Offline / Send Message
    Actually, I just noticed a bug. It seems to create an extraneous piece. By the way, the settings are really sensitive. The next time I update it I'm going to change the default values.

    Set concavityThreshold to 0 and set the merge threshold much lower, say 5%. Then bring it back up again as you iterate on the object.

    The best recursion depth setting is about 7. Unless you want something really crude keep it at last at 4. To go above 7 is pushing thing a bit.

    I'll try to fix the phantom node glitch.
Sign In or Register to comment.