Search code examples
c#2dpolygonphysicscollision

Finding the points of contact between two convex polygons


Okay, so I am trying to create a simple 2d polygon physics engine for the experience. Here is what I already know (plus sources for those who want to find out:

-How to determine if polygons are intersecting using the SAT method (http://elancev.name/oliver/2D%20polygon.htm)

-How to find the normal of the collision by finding the minimum translation axis

-How to respond to a collision via implulse (http://chrishecker.com/Rigid_Body_Dynamics#articles)

There is one thing however that keeps eluding me. That is, how to find the points of contact between two intersecting polygons. I was going to upload a simple picture to help illustrate what I mean, but it seems like I am not able to do that yet.

Specifically what I would like help on is:

-Determining which sides and/or points are colliding

-This includes when the polygons are intersecting

-Getting a vector location of each contact point

I would really appreciate anything on this because I have been searching for a good while with no luck.

Thanks.


Solution

  • After doing some more digging I found what I was looking for. I found a rather well written example (in C#) of a technique called polygon clipping. This method finds the contact points in world coordinates. It goes through all the steps and code implementation for multiple different situations.

    Here is the url: http://www.codezealot.org/archives/394