Collision detect with md2??

Started by
23 comments, last by dario_s 20 years, 11 months ago
Is there noone who can post some example code of collision detection for md2-models?
Advertisement
We''re not going to code it for you!

Why are people getting so lazy lately?

Anyway, I did some searching, and at least to encourage you to try something on your own I found these articles:
here

and here

Good luck!
I already know how to make bounding collisions... I want a way to do polygon-per-polygon collision detection, because I use md2 models in a fighting game (alot like tekken etc).

Bounding spheres are not so great in these type of games. In a quake-like game you only need to make simple collision detects, but in a kick & punch type of game you need more complex collision detections...

I dont want you to write the code for me, I already have atleast 3000 lines of code finished. And it's disturbing when a bunch of newbie's make stupid comments... Give me a smart answer or none at all.


[edited by - dario_s on April 22, 2003 1:56:51 PM]
Well, I don't think it's very nice of you to call me a newbie when I'm only trying to help you... But I'll still help you...

Even if you're making a fighting game, you can still use bounding spheres for collision... Say that every model has a bounding sphere. Then you divide the model into different bodyparts, torso, head, legs, arms, etc. Then you have a bounding sphere for each of these parts. And you can divide each of these parts into more smaller parts, with their own bounding spheres.

Then you would have some sort of a hierarchy:

                            model                      /  |                     /   |                    /  torso                  legs                  /            left leg   right leg    

Then you could check one bodypart for collision, then go to it's child, check for collision, go to the next child... etc.

Oh, and this would be MUCH faster than doing tests per-polygon..

Hope I helped!

[edited by - James Trotter on April 22, 2003 2:11:17 PM]
quote:Original post by dario_s
I dont want you to write the code for me, I already have atleast 3000 lines of code finished. And it''s disturbing when a bunch of newbie''s make stupid comments... Give me a smart answer or none at all.

Calling people who try to help you stupid isn''t going to get you far. Often times people on this forum try to *lead* people to solutions, and not tell them an answer. I don''t care how much code you have already, it''s obviously not doing the trick, so we''re going to offer ideas, and chances are we''ve solved a similar issue before, and don''t want to just GIVE our code away, and especially to someone who is (IMHO) lipping off to people on this forum.

That being said. What James said is right on. Arms, Legs, Head, Torso, etc. Bound each section in an elipsoid (sp?), and then do your detection with that. Perhaps associate with each model an array/list of elipsoids representing the contact zones.

I really don''t believe that you''re going to get the performance you want on a per polygon basis. You might, but it doesn''t seem like the best solution. Seems like a series of several bounding areas is your best bet. Sure this info isn''t in the MD2, you''ll have to figure something else out...

- sighuh?
- sighuh?
OMG, I was gonna post my code here for your copy-paste pleasure, then I saw your remark on "newbies making stupid comments". tsk tsk tsk
I dont mean to be rude, it''s just that I got frustrated trying to solve this collision detection thing. Been working on it for a week now and it''s getting pretty boring...
i never liked using librarys such as coldet myself, since i didnt know what was going on behind the scenes, call me a control freak
I was wondering , is there a way to bind a box, sphere or whatever to different parts of a md2 model without hardcoding their coordinates ? (perhaps it sounds stupid but I''m looking for a way to group faces analogue to the grouping capabilities of the 3ds format)
Thats exactly what I wanna know to... Ive found a way to get pretty decent vertex points on the animated model, but I think there must be a better way.

This topic is closed to new replies.

Advertisement