We will look at some of the techniques that are used for collision detection, and even do a little of our own.
You determine the middle point of the mesh, which will become the center point for your bounding sphere.
You then figure out the farthest vertex in the model or mesh from this centerpoint, and the distance to it is the radius of the bounding sphere.
It is important to know when objects in a game collide.
In this tutorial, we will cover the basics to get you going with collision detection.
If the object lies within these more detailed spheres, then it is recognized as a collision.
In fact, you can have as many levels as you want, which may come in handy in a very intricate model.With these methods, you would basically build a box or sphere around a model that completely covers the model.There will obviously be area that is outside of the model, but still inside of the bounding box or sphere, but an ideal bounding region will limit this as much as possible.One drawback to this method is that a sphere (or even a bounding box) may not be a good approximation for an object.For instance, imagine you have a long object, like the arrow in the image below.To deal with this problem, game programmers will use an approximation of the model that is easier to check for collisions.