The Separating Axis Theorem

GitHub Link

I did two Dissertation projects for my BSc – this was for the Physics component. I wrote and tested an interpretation of the Separating Axis Theorem in C. The Separating Axis Theorem is an implementation of the Hyperplane Separation Theorem used for detecting intersections in 2D and 3D, making it a useful efficient method for detecting collisions in games. You can read my Dissertation here, or download the project at my GitHub here. At the end of this project, I received a First grade for it.

A visualisation of how a part of the program works. In short: the Separating Axis Theorem projects the two polygons onto the normal of each face, and identifies if the projections overlap. The program could be expanded to 3D by projecting the 3D objects onto a 2D plane and then comparing collisions for the 2D shapes

In this project I used the C programming language to write a program called Collision Checker. This program can read and interpret 2D polygonal shapes, check that these shapes were valid and convex, and then compare these shapes with each other for collision. This program is part of a significantly larger project: a key feature is that it is designed to be passed to the university upon completion for use in future projects dealing with hardbody packing problems or 2D computational geometry. As such it was important that the program be clear and easy to understand, with comprehensive explanatory comments. After writing this program I performed a suite of tests on it, and utilised it on some simple collision checks involving scaling polygons to fit inside other polygons.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s