What else were you using? This is the usual approach. (Sutherland-Hodgman clipping.)
-
-
Replying to @rygorous
Usually I see SAT taught using projection: e.g. https://gamedevelopment.tutsplus.com/tutorials/collision-detection-using-the-separating-axis-theorem--gamedev-169 …
1 reply 0 retweets 0 likes -
Replying to @pcwalton
The separating hyperplane theorem is usually expressed using projections because that works for all convex sets and many relevant convex sets don't have a finite number of vertices. But Sutherland-Hodgman (and derivatives) is still the standard approach for convex _polygons_.
2 replies 0 retweets 1 like -
Replying to @rygorous
It was a lot easier for me to understand starting with S-H as opposed to the other way around. I wish tutorials taught S-H first.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
*puts on maths hat* The whole "Separating Axis Theorem" thing is a super-unfortunate Computer Graphics idiosyncracy (like the infestation with row vectors that originated in Utah in the 70s). The axis is the wrong thing to look at; it's the dual of the thing that makes sense.
1 reply 0 retweets 2 likes -
The actual theorem in convex geometry is the Separating *Hyperplane* Theorem (and its generalizations such as the Hahn-Banach theorem). In 2D, it states (slightly simplified) that two convex objects are non-overlapping if and only if you can draw a line between them.
1 reply 0 retweets 0 likes -
I.e. if and only if there is a line such that object A is on one side and B on the other. In general n-D, the same is true with a n-dim hyperplane (thus Separating Hyperplane Theorem). Note that this is *exactly* the intuition you arrived at.
1 reply 0 retweets 0 likes -
But mathematically, _that's the actual result_! You happen to be able to find an axis (corresponding to the hyperplane's normal; in 2D, a perpendicular to the line you drew) but the interesting object is the hyperplane itself.
1 reply 0 retweets 0 likes -
Now, for 2D polygons, the simplification that happens is that the object itself is made of straight-line segments; and that allows you to only consider lines going through those line segments as separating line candidates.
1 reply 0 retweets 1 like -
(The intuition here being that these are the tightest possible lines you can fit to that polygon, and if those can't separate the polygon from the other object, nothing else that's further out possibly can either.)
1 reply 0 retweets 0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.