Sign in to follow this  
VisionForce

Collision Detection in 3D

Recommended Posts

I know how to implement collision detection in a 2D world, but in a 3D world I don't know how to get the depth or the height of a mesh. How would I do this? Is there a different way I should be doing collision detection?

Share this post


Link to post
Share on other sites
I suppose the first question is what exactly do you want to detect collisions between? 2 complex meshes? a mesh and a ray? simple geometric objects like cubes and spheres.

I would quickly recommend having a google for 'Bounding volumes'. I'd post some links but i dont have any on my work computer im afraid.

Share this post


Link to post
Share on other sites
Collision between two complex meshes, like a man and a tree. I know about using the less complex meshes for when they're far off or when extremely precise collision isn't needed (like in Battlefield 1942), but I just need to know how to implement this collision. And thanks, I'll search Google for that and see what turns up. I really need something that's DirectX related; any Microsoft language will work and it can be either DirectX 8.1 or DirectX 9.

Share this post


Link to post
Share on other sites
Bounding volumes arn't API specific. so they can be used just as well in DX as OGL.

what kind of level are you looking for with the collisions? is it just a case of stopping the guy walking through the tree? (for example) If that is the case then i would guess that bounding volumes would be sufficient. Heres a couple of terms that will be worth searching.

Axis Aligned Bounding Boxes (AABB)
Oriented Bounding Boxes (OBB)

heres a quick link i found that I've used before (in fact it's what I used to learn how to use boundign boxes in the first place)

http://www.toymaker.info/Games/html/collisions.html

Share this post


Link to post
Share on other sites
The toymaker.info site looks like it will be very helpful for beginner collision detection (which is what I need), but I'm not sure what the assert method does in C++. Is like like the Debug assert in VB?

Here's an example of how they used it:
assert(minB);

[edit] I also need info on how to carry out ray collision tests against all the triangles that make up my world; you know, intense collision detection so that I can let game players shoot a gun in between a tree's branches. That won't happen with bounding boxes when it comes to those little tiny branches.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this