Archived

This topic is now archived and is closed to further replies.

NeXius

Try my physics demo?

Recommended Posts

Hi I saw the great character physics in UT 2K3 and tried to implement it myself, to limited success... Getting the physics to work didn''t take very long, but positioning the model according to the physics skeleton is downright impossible! I''ve tried everything.... If nobody can help me than I plan to give up, since I''ve spent too much time on this already... Anyway, this is what I have at the moment. I''m confident I can fix the bugs with the physics, but if I can''t figure out how to draw the model over the skeleton then there''s no point... Right now this is how I''m trying to do it: I calculate the directional vector from the root joint in the physics skeleton to a child joint and then calculate the rotation required to go from the initial directional vector to this current one... and then apply the rotation to vertices that are attached to the bone corresponding to this joint on the model. (the model uses skeletal animation) But this looks terrible! I have no idea what else to do... Any suggestions would be very appreciated. Thanks

Share this post


Link to post
Share on other sites
A firewall can''t stop an HTTP file download from working. It works fine for me now as well; I guess there was something temporary wrong with the server.

Trying the demo now...

---
shurcooL`

Share this post


Link to post
Share on other sites
It looks like your joints are simple, single, point-to-point constraints - i.e. one point on the head is constrained to be colocated with one point on the torso. Anyway, this isn''t enough to stop the joints spinning around, which will mess things up.

You can easily construct "hinge" joints from pairs of the point-point constraints - this will stop the limbs from rotating around unwanted directions. However, your ragdoll will then look rather wooden, because hinges don''t represent the shoulder/hips/neck very well. Two ways of getting around this are:

1. make universal joints out of two hinge joints. These will work OK, allowing you to specify the joint limits independantly in the two hinges. However, every extra hinge introduces its own problems...

2. Make a "sloppy" hinge by using 3 point-point constraints:

1
BODY_A 2 BODY_B
3

Each number represents a point-point constraint between bodies A and B. constraint 2 is enforced strongly, so that the two bodies stay connected at all times. However, allow some sloppiness when enforcing the constraints 1 and 3 - controlling the amount of sloppiness will allow a bit of rotation around the non-hinge axes.

You also need to work out how to apply limits on the joints (can be done with a constraint on the max distance between two points on pairs of bodies), and also do self-collision between the limbs.

Might be able to help more/better if you gave some details about how you''re implementing this (e.g. put the source code in your zip file...)

Share this post


Link to post
Share on other sites
Thanks for your reply.

OK well I've updated the demo to show my attempt at applying the mesh to the physics model...

It looks terrible at the moment, because it can spin around the direction it points into.

(hit 1 and 2 to see the physics skeleton again)

I've also added the source into the zip file, so hopefully it's readable enough for you to understand what's going on

I know what you mean about adding more constraints, but right now I'm just concentrating on getting it to not look like crap when I apply the model to it. If I can't figure that out than it's not much good, for my purposes at least

[edited by - nexius on January 18, 2004 5:13:00 PM]

Share this post


Link to post
Share on other sites