Skip to main content
gamedev.net
🔒 Locked

SkinnedMesh collision detection

Started by rcode Oct 8, 2001 at 2:38 PM 1 replies 500+ views
Original Post
rcode
rcode
I''ve got the SkinnedMesh program loading up models exported from Maya, and am now trying to add collision detection for my models. The game is basically a fighting game with two character models on screen. I''d like to place bounding spheres on different areas of the model''s body, and have the spheres move to the appropriate positions when the frames are animated. Any ideas on the best way to specify the bounding spheres, and also how to make the spheres move with the body parts that are animated? I thought about specifying the spheres somehow in Maya, then recognizing them in the program and not drawing it in the program, but couldn''t come up with a way of doing that. Another idea, I had was to somehow detect the joints in the skeleton bones and place spheres at the joints, but again I had no clue how to do that. Thanks in advance for any suggestions!
RCode
cheez_keeper
cheez_keeper
I believe one of the examples in the DX8SDK was a collision detection between 2 meshes without bounding spheres. I know for certain there is one for detecting a vector through the mesh. Since each poly has a vector you could just use that to see (also you only have to check certain ones like the hands/feet/head/etc...). I mainly deal with 2D and have always used bounding sphere detection since I wrote my own little .asm detection routine. My solution there would be to set up about 5-6 small spheres (hands/feet/head/etc...) and check those against 3-4 larger spheres on the other mesh (legs together/torso/upper body) You would need to calculate out the x/y/z of the vertex of these spheres/ellipses, but you could do that based on a subset of vertices from the larger mesh i.e. if a hand had verts 0,0,0;0,0,1;0,1,0;0,1,1;1,0,0;1,0,1;1,1,0;1,1,1 (a cute little cube) then its vertex would be .5,.5,.5 with a radius of .866...
Of course this wouldnt work well if you had to check a large number of spheres, but for a reduced set (as in 2 people duking it out) this would work very quickly.

Brett Lynnes
cheez_keeper@hotmail.com
Brett Lynnescheez_keeper@hotmail.com
rcode
rcode
Brett, thanks for your suggestion on using the vector thru mesh algorithm for collision detection. That seems like something that might work -- I''ll check it out. Your second suggestion about setting up spheres would work if the models were static, but the models are animating; thus the spheres would need to move along with the body part that is moving. I''m not sure how to do that by looking at the SkinnedMesh program, but would venture to guess that it has something to do with the bones affecting the skin, and using that information to appropriately move the bounding spheres on that body part. Thanks again for the suggestions, and if anyone else has any ideas on implementing collision detection for the SkinnedMesh program then let me know.
RCode

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.