I have managed a simple spherical collision detector, but I need something more complex.
Am I right in thinking that the "select.c" example in the MSDN library is to do with frustum-shaped collision? And if so, is this an efficient method to use?
Printable View
I have managed a simple spherical collision detector, but I need something more complex.
Am I right in thinking that the "select.c" example in the MSDN library is to do with frustum-shaped collision? And if so, is this an efficient method to use?
<geometric shape>-Frustum collisions are used for culling offscreen geometry from being rendered. The frustum is the volume thate xtends from the near cllip plane to the far clip plane, bounded by planes that correspond to the screen edges. Think of it as a truncated pyramid.
There are several methods of collision detection, generally used in a heirarchy, with the least expensive tests used to determine if a more expensive test should be used. Generally, in order:
Doing a web search will bring up hundreds of results for you.Code:Sphere-Sphere
Bounding Box-Bounding Box
Triangle-Triangle
Z.
As I understand it, the select.c example does the following:
- Sets the viewing volume to the shape of the bounding box for the collisions.
- Switching to GL_SELECT render mode which doesn't actually do anything except say what shapes exist within the viewing volume (e.g. which shapes have collided)
- Draw all the shapes, see with ones have collided.
- Says which shapes have 'collided' with the bounding box
Is that right?