Skip to main content
gamedev.net
🔒 Locked

COLLISION DETECTION

Started by lxnyce 5 replies 200+ views
Original Post
lxnyce
lxnyce
your message boards are cluttered with collision detection questions (3d mainly). Why doesn''t someone write a real document where there are actual code to view on how to go about this. Everybody knows how to collide a ray with a polygon, but can someone please do something on sphere collisions. Something like how quake was done I guess.
ryoder
ryoder
I agree that collision detection would be excellent but sphere collisions are so dang simple they don''t merit an article.

What is needed is arbitrarily oriented bounding box collision detection.

I''m looking into it and if I find anything I''ll post a link.

If I don''t find something I''ll try my hand at writing the following algo.

int CollideBoxes(BoundingBox *boxOne, BoundingBox *boxTwo);

It would return 0 if they didn''t collide and something else if they did.

Or just a boolean but an int would have the ability to return specific info.

MCSE, MCSD, Sun Certified Java Programmer
Pimp Daddy ;)
MCSE, MCSD, Sun Certified Java ProgrammerPimp Daddy ;)
a2k
a2k
hey ryoder, check this out:

http://www.cs.cmu.edu/afs/cs/user/baraff/www/pbm/pbm.html

everything you ever wanted to know on rigid body dynamics.
rigid body II covers covers collision detection with bounding
boxes.

also, chris hecker's articles are very good for starters, too. the sample apps are very informative, but they take a while to understand.

have fun, and don't strain yer brain. i'm in the middle of doing that right now.

a2k

Edited by - a2k on June 29, 2000 10:51:31 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
ryoder
ryoder
I checked out that site and the documents but its not exactly what I want.

On gamasutra they have an article about separating planes and checking to see if the plane separates completely, both boxes.
My specific case involves not 2d convex polyhedra but 3d rigid orthogonal bounding boxes which are not axis-aligned.

Thanks for the link though.

I am also looking for something quick and dirty that is optimized to be used in a real-time 3d game.



MCSE, MCSD, Sun Certified Java Programmer
Pimp Daddy ;)
MCSE, MCSD, Sun Certified Java ProgrammerPimp Daddy ;)
a2k
a2k
um, my objects are *3d rigid orthogonal bounding boxes which are not axis-aligned.* and the articles cover them pretty thoroughly.

if you wanna use something quick and dirty (but it's still very good) check out www.mathengine.com. it's a physics API and the demos are really convincing. the process for obtaining the libraries is quite grueling, but i'm sure the API is very good compared to anything started from scratch.

a2k


Edited by - a2k on June 30, 2000 12:09:42 PM
------------------General Equation, this is Private Function reporting for duty, sir!a2k
ryoder
ryoder
Ok I found something that looks great.
Go to magic-software.com

Look at intersections.
Particularly the OBB intersections.

I am going to make a d3d version of this which has no dependencies except d3dtypes.h etc so that people can integrate it into their apps easily.

When I''m done, I''ll post the complete source.



MCSE, MCSD, Sun Certified Java Programmer
Pimp Daddy ;)
MCSE, MCSD, Sun Certified Java ProgrammerPimp Daddy ;)
benjamin bunny
benjamin bunny
I don''t know if you found a solution to bounding boxes yet, but if you didn''t, one way of doing it if you wanted to find if a point was in a box would be to use the plane equation to determine if a point was behind or in front of the six planes of the box. If the point is behind all six faces it''s within the box, otherwise it''s not. I don''t know how you could apply that to two boxes though.

http://www.geocities.com/ben32768

Topic Locked

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

Sign in to reply to this topic.