3D Collision Detection (Edge-Edge)
how do i find whether or not edges of a polygon are colliding? the colliding objects are two boxes. i was thinking of just finding the shortest distance between every line segment that make up the objects, and if the shortest distance is within a constant collision threshold value, the objects collide. is this the way to go? cuz it sounds like a lot of tests. (i.e. if each box has 12 segments, each segment would have to be tested against the 12 segments of the object in question)
a2k
Edited by - a2k on 7/25/00 12:21:32 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
that''s why bps''s and portals and octrees, etc... were created. to only test what needs to be tested. for example, you test which sector you''re in and only test for that sector''s collision.
JoeMont001@aol.com www.polarisoft.n3.net
JoeMont001@aol.com www.polarisoft.n3.net
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
but does this apply for OBJECT/OBJECT Collision too? because what it is, is PLAYER-PLAYER COLLISION. each player is comprised of a box, which is made up of 6 planes, from 8 vertices, which form 12 line segments. i'm not quite sure how bsps, octrees etc can help me with that.
a2k
Edited by - a2k on July 25, 2000 1:35:08 PM
a2k
Edited by - a2k on July 25, 2000 1:35:08 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Why do you want to do bounding box collision with players? If you really need that accuracy then you will have to test every edge against every edge, but you won''t have to check unless the objects are within a certain distance of each other. And if you''re only checking then, why not just work with bounding spheres... Unless you do need to extra accurracy.
-BacksideSnap-
-BacksideSnap-
yes, i need the extra accuracy. i already have bounding sphere detection implemented. it''s a simulation.
a2k
a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
well ... im using bounding box collision detection in my "game" ...
im using a bsp-tree/octree-mixture for the landscape --> this makes it very fast ... but it doesnt help if u want to do collision detection for dynamic objects ...
if u want to do bounding box collision ... you create 6 planes that "sourround" the space that the object will move in the next "tick" ...
then you check the triangles if they are inside this space ...
if no triangle is in this space --> no collision occured ...
i can probably explain it more if thats what your lookin for
im using a bsp-tree/octree-mixture for the landscape --> this makes it very fast ... but it doesnt help if u want to do collision detection for dynamic objects ...
if u want to do bounding box collision ... you create 6 planes that "sourround" the space that the object will move in the next "tick" ...
then you check the triangles if they are inside this space ...
if no triangle is in this space --> no collision occured ...
i can probably explain it more if thats what your lookin for
i guess either i'm really dumb, or people are not reading properly.
i said PLAYER TO PLAYER COLLISIONS.
not environment (wall) collisions. i've got that covered already. the players are bounded by a box, and these boxes need to be checked for collision.
now, if the picture works, this is what i mean.
how do you do this thing? okay, well, anyway, i got it up, and as you can see, i'm not to in-the-know with html.
so, take a look, and tell me what you think.
a2k
Edited by - a2k on July 25, 2000 10:34:40 PM
Edited by - a2k on July 25, 2000 10:35:52 PM
i said PLAYER TO PLAYER COLLISIONS.
not environment (wall) collisions. i've got that covered already. the players are bounded by a box, and these boxes need to be checked for collision.
now, if the picture works, this is what i mean.
how do you do this thing? okay, well, anyway, i got it up, and as you can see, i'm not to in-the-know with html.
so, take a look, and tell me what you think.
a2k
Edited by - a2k on July 25, 2000 10:34:40 PM
Edited by - a2k on July 25, 2000 10:35:52 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
I think your answer may be "Cutting Edge 3D Game Programming with C++" by John DeGoes. In chapter 11 (which I only skimmed) he first finds candidates with bounding spheres, then verifies with intersecting planes. The latter may be the key you''re looking for....
I'm certainly no expert on collision detection, but why don't you try something like this:
we have two bounding boxes, A and B - B is the bounding box of the object that you are trying to work out if it intersects b.b. A
you have 6 planes which represent bounding box A - each plane has an axis aligned normal pointing away from the center of the object.
first check: if any of the vertices of B are behind ALL of A's planes, then there is an intersection (this is the simplest case)
second check, part 1: for each of A's planes, calculate if all of B's points are on the same side of that plane.
second check, part 2: if for three planes which are each aligned to a different axis, 2nd-check-part-1 is false, then there is an intersection
if you can understand that (i'm not too great at explaining things ), i think that should work...
if you want me to try and explain it better, reply to this then e-mail me here so that i don't miss the message
Edited by - remo on July 26, 2000 8:41:11 AM
we have two bounding boxes, A and B - B is the bounding box of the object that you are trying to work out if it intersects b.b. A
you have 6 planes which represent bounding box A - each plane has an axis aligned normal pointing away from the center of the object.
first check: if any of the vertices of B are behind ALL of A's planes, then there is an intersection (this is the simplest case)
second check, part 1: for each of A's planes, calculate if all of B's points are on the same side of that plane.
second check, part 2: if for three planes which are each aligned to a different axis, 2nd-check-part-1 is false, then there is an intersection
if you can understand that (i'm not too great at explaining things ), i think that should work...
if you want me to try and explain it better, reply to this then e-mail me here so that i don't miss the message
Edited by - remo on July 26, 2000 8:41:11 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement