Sign in to follow this  

SDL&OpenGL polygon collision

This topic is 3739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I'm using SDL and OpenGL, I have mostly worked with SDL only, but now I want to learn some SDL with OpenGL also. So.. I have made a function that draws a polygon to the screen defined by the user, but I need to know how to make it check if there is collision between two polygons. How to do this? Just tell if you need more specific info

Share this post


Link to post
Share on other sites
Collision detection does not have anything to do with sdl or opengl.
I guess you could use the sdl blitting functions somehow for overlap checking if you were desperate, but that is not a very efficient way to check for collisions.

I would suggest the separating axis theorem (http://www.harveycartel.org/metanet/tutorials/tutorialA.html) for collision detection between convex polygons.
You should know if you just want to work with sdl and opengl with no other third party libraries, you have to implement the collision detection code yourself (afaik there is no collision detection code in the sdl).

Share this post


Link to post
Share on other sites
I think I'll use some libraries to check the collision to save some time, my busy with school and other stuff so coding a brand new collision engine would take too long for me.

So what library do you suggest to use when checking collisions between polygons?

Share this post


Link to post
Share on other sites

This topic is 3739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this