Collision Detection Tutorial
I've searched everywhere but I couldn't find a tutorial that learns you how to code some real basic collision detection. Does anyone know a good tutorial? I'm programming in C++ and OpenGL.
It's a pretty fleshed out topic, I think that you need to be more precise. For example when you say
Then I could reply
Which is a valid answer to your question, but that's probably not what you are looking for. General collision detection for arbitrary cases is not a basic issue, although you could do a brute force triangle-triangle check on your entire scene, but that won't extend well at all. You usually have specialized cases for different collision shapes.
For example a quick [google] revealed Basic Collision Detection. There is even a tutorial on NeHe for a few cases if you want it to be in the context of C++ and OpenGL.
Quote:
how to code some real basic collision detection
Then I could reply
bool checkSphereCollision(vector position1, vector position2, float radius){ if ( (position1 - position2).length() <= (2 * radius) ) return true; else return false;}
Which is a valid answer to your question, but that's probably not what you are looking for. General collision detection for arbitrary cases is not a basic issue, although you could do a brute force triangle-triangle check on your entire scene, but that won't extend well at all. You usually have specialized cases for different collision shapes.
For example a quick [google] revealed Basic Collision Detection. There is even a tutorial on NeHe for a few cases if you want it to be in the context of C++ and OpenGL.
Here's a really great tutorial:
www.paulnettle.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf
www.paulnettle.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf
It'll help you if you first formulate what exactly you're looking for. 2D collisions or 3D? Just squares/blocks or arbitrary shapes? And once you're able to detect collisions, what kind of response are you looking for?
Anyway, you may find this tutorial on the Separating Axis Theorem usefull, if you're into 2D.
Anyway, you may find this tutorial on the Separating Axis Theorem usefull, if you're into 2D.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement