View Full Version : It's a big subject, and i need help (collision detection
01-08-2002, 03:31 PM
Does anyone know where i can get a tutorial and example code on how to use collision detection with games in opengl
01-08-2002, 04:07 PM
01-08-2002, 09:35 PM
Freely available 3D collision code:
01-09-2002, 12:30 AM
John Nagle, I must thank you very much for your links to V_COLLIDE and SWIFT.
01-09-2002, 07:53 AM
There was a huge list of sites posted a few weeks back. Doesn't anyone use search on here anymore? There are TONS of great posts on this and most everything else you can think of.
01-09-2002, 10:14 AM
I can not thank you enough for these links
01-09-2002, 03:16 PM
How about tutorials on how to use these... Does anyone know how to apply this to opengl!?
01-09-2002, 09:00 PM
What do you need? OpenGL is NOT used at all. It is *ONLY* for rendering.
It also depends which method you are going to use in your collision routines, and if you are using rectangles, triangles, or circles or whatever. Just feed whatever you are using into the collision routine, THEN render with openGL what happens, like a big KABOOM when a bullet hits the gas tanks.
01-10-2002, 02:09 AM
I think i have it now, it's like collision detection is used for that, opengl rendering, direct input input... so on.
I'm using triangles btw
01-10-2002, 01:22 PM
Also coldet (http://photoneffect.com/coldet/ ) is a very handy library for collision detection. I use it in one of my works-in-progress (http://www.wizards.de/~frank/project2501/ ) with great success.
But mind the words of the jogi masters - while collision detection is easy, good response is hard http://www.opengl.org/discussion_boards/ubb/wink.gif
For a simple case such as firing bullets at a target, you could try using the select mode in OpenGL. Use an ortho view the width of the bullet, from the initial position of the bullet, looking in the direction the bullet is moving, and with the far limit set to the distance the bullet will move in this frame. Now draw the target. If the number of entries in the select list is 0, you missed. Anything greater than 0 and you hit it somewhere.
The direction vector I used had to be relative to the target, since the target speed was not negligible.
This wouldn't suit cases where neither object can be treated as a point, but it was good enough for my purposes and the main part of the new code was only about a dozen statements..
The main problem I think is that the technique you describe will not be very fast where real collision detection is needed.
It may happen that this technique can be used for a quick'n'dirty test but you shouldn't create a whole collision detection system based upon this.
01-11-2002, 10:37 AM
Does anyone know where i can get tutorials on coldet? I've seen it, but I didn't bother cause I didn't see any docs on using it...!?
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.