PDA

View Full Version : Colision Detection



lud2k
02-02-2005, 02:46 AM
Hi,

I would like to know how i can detect the colision with a character and my world.

Is there a way to know the colision between a ray and the world in opengl ? If that's possible i could add a ray on the character that going down so i'll have the position of the ground so i can put the character at the good place..

Is a function like gluUnProject witch return the position of colision but for a ray ? If i change camera view and i put it on the character looking down without drawing that could work no ?

Thanks,
Ludo

wizzo
02-02-2005, 03:43 AM
openGL is a RENDERING API, so it means it doesn't provide any means to do collision detection.

To check collision with a model, the easiest way is to define a sphere around the model, and collision-test it with the enviroment.
To do so, check out this site : www.gametutorials.com (http://www.gametutorials.com)

wizzo

lud2k
02-03-2005, 01:23 AM
oki thanks a lot ^^
I'll make it myself :-)
Have a nice day everybody.