   Clarifications about Seperating Axis theorem
  Hi everyone,I've been looking into SAT for some time now and attempted to create a demo for my own understanding. The demo basically aims to create a manager class that would dynamically calculate collision between two convex polygons using SAT.Note that I am definitely not an expert in mathematics. I've lost a bit of touch in vectors, but I have read up to refresh my memories before doing this.Here is what I understood about the SAT process, please correct me if my steps are wrong:1) Choose a vector from a polygon.2) Calculate its normal (the separating axis)3) Project all the points (based on world origin) from both polygons onto the axis. I think you are supposed to get the magnitude of each points from origin here instead of the vector since you are going to calculate minimum and maximum. 4) Calculate the minimum and maximum magnitude of all the points you projected for each polygon. The magnitudes are 'absoluted'.5) Check for gaps (whether the min or max points of polygon A are within the min and max range of polygon B)6) If there is a gap, stop everything. If there isn't, repeat steps 1-6. If no gaps are found throughout, go to step 7.Okay now here I have tons of problems. This part calculates the projection vector: 7) Find the shortest distance of intersection amongst all the results.8) Multiply that distance with the axis it belongs to. That is the vector you need to use to 'push out' the colliding object.Okay here are a few things I want to know:I think it's better to discern the right normals before hand, since I'm multiplying my magnitude by the separating axis. Although Vector(1,0) and Vector (-1,0) are the same line, they have a different direction. In other word, if I blindly pick vectors, I have no real way of telling whether to project towards the left or the right of the axis, since I have no idea what kind of direction I'm working on. Furthermore, I have no idea where my body is. My right-angled triangle can be:-/|/_|OR__\ |-\|For the first picture, assuming origin is bottom left, I would use the Vector(-1,1) as my separating axis, while the second picture, I would use Vector( 1,-1) as my separating axis. This the above statement is true, then I'm ready to move on to applying it. Regards.   
  the signs sort themselves out. It all depends what part of the intervals intersect. say you project along the +X axis.Quote: axis of projection (+1, 0)------->a)   +---------------++---------+|......>| '+9' units-> mtd = Vector(+9, 0)b)  +---------------+  +---------+  |<...| '-6' units-> mtd = Vector(-6, 0)If you project the other way    Quote: axis of projection (-1, 0)    <-------a)   +---------------++---------+|......>| '-9' units-> mtd = Vector(+9, 0)b) +---------------+ +---------+ |<...| '+6' units-> mtd = Vector(-6, 0);  In 2D this can be done much easier:for ( all edges )- build outward pointing normal n for this edge- get support vertex in direction of -n on other polygon- separation is the distance of the support vertex to the edge planeThe edge plane is a plane defined by one of the edge vertices and the edge normal. If the separation is greater zero you have found a separating axis and can exit. If the separation is less than zero you need to continue and e.g. keep track of the axis of minimum penetration.In 3D it is exactly the same. Handling the edge-edge directions is a little bit more tricky though.HTH,-Dirk;  @oliiihmm, but if I projected onto a X or -X axis, wouldn't I get the same value? I have no idea how you came up with the negative values for the -X-axis example. Unless you are suggesting me to flip my equations? (ie, x0-y1 becomes y1-x0). @DonDuckieA bit foggy about what you are trying to say. I'm concluding that its the basic summary of SAT, although I'm unsure what the supporting vertex is though. I'm assuming it's the point or vertex that is the closest to the edge I'm facing? Confused. But the first and last steps made sense. So in the end, it's best that I know which normal I require (the outward one as you mentioned).   