Convert mesh into dynamics data

Post Reply
lamxuyen
Posts: 2
Joined: Wed Sep 05, 2018 8:25 am

Convert mesh into dynamics data

Post by lamxuyen » Wed Sep 05, 2018 8:29 am

Hi everyone,

I am trying to convert a mesh (a dinasaur) into a ragdoll, so I have a list of affected vertices/triangles for each bone which tell me what the bone influences.
This model is already skinned and animated so I know everything is correct.

I am trying to work out how to create bullet data from this by using each mesh part and then joining them together with constraints.
My idea was to use some kinda program to estimate if its better to create a simple primitive like capsule, sphere, box or if that's not adequate then create a convex hull.
From what I understand a convex hull is much slower? Or would it be feasible to just create a convex hull for everything? with v-hacd?

Searching google I did find these links which have a program which is meant to be what I need however these links are dead and I can't find them anywhere else.

amillionpixels.us/CreateDynamics.zip
amillionpixels.us/CreateDynamics_1.0.exe

This is for a mobile game so I kind of need good performance with 30+ ragdolls at any one time, does anyone have any advice for me?

Thanks

User avatar
drleviathan
Posts: 455
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Convert mesh into dynamics data

Post by drleviathan » Fri Sep 07, 2018 3:46 pm

I too would like to have a really smart convex-decomposition tool that could suggest optimized shape approximations for mesh sub parts. I'll probably eventually try to write one myself but I think it is a year or two down the road. I've got a few ideas on how one would go about it, but they are mostly brute-force methods that would most useful as offline tools rather than real-time, and something real-time would be very nice to have. Meanwhile, there are a number of academic papers about convex decomposition algorithms that are alternatives to VHACD, but I don't see many free and easy libraries for them.

As to whether bullet could push 30+ ragdolls of the simplest convex shapes on mobile hardware: you'll just have to test it to see. I don't know of real data on which shapes would be fastest, especially for your specific hardware platform.

The btConvexHull::localGetSupportingVertex() method which is the workhorse of the GJK algorithm used for the narrowphase collision calculations of that shape is brute force: it just performs N dot products with the the N hull vertices looking for the maximum value, so the smaller value of N the faster it would be.

Meanwhile, there is a btMultiSphereShape which could be used as a good approximation of some things and is probably quite fast when there is a small number of spheres.

StabInTheDark
Posts: 29
Joined: Sat May 18, 2013 1:36 am
Location: NY
Contact:

Re: Convert mesh into dynamics data

Post by StabInTheDark » Mon Sep 10, 2018 6:10 pm

The way I did ragdoll was to rig the mesh with a skeleton as you do for animation.
Your mesh vertices will be assigned to the skeleton so all you have to do is position and rotate the
bones with the data from the bullet collision shapes.
Create a capsule collision shape for you major bones and position them at the
skeleton bones positions, place your constraints at the bone conections.
You can go from animation to ragdoll with ease. I tested with 20 on Android tablet and phone.
I built this system into a mobile programming language called App Game Kit(AGK).
https://www.appgamekit.com/
https://www.youtube.com/watch?v=N93j9ZoGbok

Post Reply