I'm trying to learn the Separating Axis Theorem, for my programming. I'm making a simple 2D game an I need this as a way to detect wether two polygons are intersecting.
Problem is, I suck at math.
So far, I understand that in order to know if two polygon are intersecting, I need to do the following:
- Creata a perpendicular line to every edge of the two polygons.
- Project each polygon to each of the new lines created (the axes).
If all projections of the first polygon overlap all projections of the second polygon, the shapes intersect. Else, the shapes do not intersect.
I know how to do step 1. But I don't understand how to perform step two.
Can you explain to me how to project a polygon onto an axis, in a language that a person with pretty basic knowledge at math will be able to understand?
Thanks a lot