Advertisement Jump to content
Sign in to follow this  

collision between human mesh and ball

This topic is 1908 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


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

Share this post

Link to post
Share on other sites

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. 

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!