Reputation: 31
I did a lot of research on the topic, but didn't really find the exact answers I'm looking for, perhaps there isn't the one perfect solution... I was wondering how to perform 3D collision detection in video games.
Is it best to use collision volumes like spheres and boxes and check for intersections or is there an even simpler method, like just comparing positions and vectors of objects to know if they are intersecting?
Upvotes: 3
Views: 4592
Reputation: 808
This is a vague question. It all depends on WHAT you are ACTUALLY doing. if its a box you check for collsions between the sides relative to the centre. Come to think of it you do the same with a Sphere (radius).
It's also worth noting that the collision is the easy part, it's what you want the objects to do after they collide that is the hard part, and its also when the shapes come into play more. i.e. A sphere and a square colliding is going to act differently to a sphere and sphere.
A good way is to combat the collision on one axis and then move onto another. Dont make it hard for yourself.
Worth a read through : http://www.gamedev.net/page/resources/_/technical/game-programming/general-collision-detection-for-games-using-ell-r1026
After that its going to be worth buying a book on general games programming and working through it and then you can see hands on what the best way is for what your doing.
Hope this helps
Upvotes: 2