Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


collision between human mesh and ball


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 anders211   Members   -  Reputation: 215

Like
0Likes
Like

Posted 01 November 2013 - 08:21 AM

Hi

My knowledge about collision is very basic, I just know that meshes are approximated into boundingBoxes or boundingSpheres and then You just use AABB technique and in this way You are able to detect collision. However when You have some complex meshes like human I cannot use one boundingBox/boundingSphere because when there will be contact with the ball (shoulders/legs/knees) then the effect of bounce will be not realistic as probably the ball won't even contact with the body when it will be bounced into opposite direction.

Second fact is that my human mesh is also animated (run, walk/ move the hands etc.).

What technique I should use to detect collision between human and the ball? My concept:

1.) I created in Blender my mesh and then exported it to x file. So use Blender once again and create rectangular and sphere obejcts per bone so they approximize the original mesh. Assign to each rectangular/sphere object weight =1 per bone by which it is covered. Then export such rectangular mesh to x file.

2.) Import two meshes (one normal and second one rectangularized). There is such function in directX as GetVertexInfluence for each bone or something like that. With the aid of this function try to find all rectangular/sphere objects. In this way You will have boundingBoxes of the original mesh.

3.) In each frame when You move the animation find which matrix (final/offset or other one) will transform Your boundingBoxes/spheres so that they follow animated bones.

 

That is my algorithm I invented partly on my own and partly through the google. If anybody has any idea how to improve my algorithm or have better idea how to create bounding box per animated mesh I would be grateful.


Edited by anders211, 01 November 2013 - 12:32 PM.


Sponsor:

#2 Seabolt   Members   -  Reputation: 755

Like
0Likes
Like

Posted 01 November 2013 - 03:59 PM

You're on the right path. You will definitely need some sort of geometry that moves with the appendages so you can associate the collision to a specific part of the body. From there you need to be able to perform and Object Oriented Bounding Box collision test. It's a bit more expensive but not too much more complex than a standard AABB collision check.

Also to generate your collision volumes, you may find it easier to just determine the width of the bone, (remember a bone is the connection between two joints), and then build a bounding volume of that length with some modifiers to increase width, height, depth so you can totally encapsulate geometry. Then you just need to orient box around the bone. You should be able to transform the corners of the box by the joint transforms. I'm just guessing on this though. It may help reduce the need to model two meshes but it's definitely not as flexible. 


Perception is when one imagination clashes with another




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS