|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| 2D Rotated Rectangle Collision |
|
![]() janta Member since: 2/7/2006 |
||||
|
|
||||
| Nice article. It would be interesting to see whether it can be extended to 3D? |
||||
|
||||
![]() Ravyne Member since: 2/26/2007 From: Kirkland, WA, United States |
||||
|
|
||||
| A very nice explanation on a substantive article. Great work, and thanks for sharing. |
||||
|
||||
![]() Iced_Eagle Member since: 12/13/2004 From: Bellevue, WA, United States |
||||
|
|
||||
Quote: I have yet to try, but I don't see an issue (you could just go face by face in each 3D rectangle). I would be curious though if anyone has ever done this method? Anyways, I've done this in 2D as well a year ago. It worked like a charm. Great article! |
||||
|
||||
![]() chronozphere Member since: 6/16/2007 From: Alkmaar, Netherlands |
||||
|
|
||||
| Outstanding! I'd like to see a 3d version of this algorithm too. I might implement one in the future. :) |
||||
|
||||
![]() GMano Member since: 7/23/2008 From: Salt Lake City, UT, United States |
||||
|
|
||||
| I have used the 3D version in the past, and it works well. David Eberly gives a fairly complete treatment of this here: http://www.geometrictools.com/Documentation/MethodOfSeparatingAxes.pdf |
||||
|
||||
![]() GreenToad Member since: 7/18/2003 From: Emeryville, CA, United States |
||||
|
|
||||
| I just implemented this based off your article here, and it works great. Thanks for the article! |
||||
|
||||
![]() jvitela Member since: 2/17/2009 From: Madrid, Spain |
||||
|
|
||||
| Nice article! There is also another tutorial with interactive flash examples on the metanet's site, here is the link if someone's interested: Click Me |
||||
|
||||
![]() EMeythaler Member since: 10/16/2008 From: Casselberry, FL, United States |
||||
|
|
||||
| I appreciate the positive feedback I've gotten on this article; I'm glad you found it interesting and that some of you were able to put it to use. In my project that inspired me to write this article, I didn't do any physics simulation beyond simple collision detection. However, the Separating Axis Theorem can be used to provide some excellent collision information useful for physics in addition to just detecting a collision. The games "N" and "N+" both use the Separating Axis Theorem for their collision detection and physics. I don't have the time to track it down now, but somewhere on their website: http://thewayoftheninja.org/n.html they have an article detailing how to use the Separating Axis theorem for physics. - Eric |
||||
|
||||
![]() gslagel Member since: 2/1/2009 From: Lakewood, CO, United States |
||||
|
|
||||
| Hey, I can't believe my luck that this article was posted so recently. I spent the morning learning about the Separating Axis Thereom, decided it was perfect for what I wanted, then fell into a depression imagining the struggle I was going to have applying it to my rotated rectangles. As someone who hasn't had to find a projection in over four years, I really really appreciate this hand-holding walkthrough. Thanks! |
||||
|
||||
![]() ROBERTREAD1 Member since: 10/13/2005 From: Clapham |
||||
|
|
||||
| Just one point, Squared distance is faster to calculate. It can be wise to utilize a SQUARED radius that completely encompasses the rectangle. If the SQUARED distance between the centers of rectangles A and B is greater than the radius of A and B added together then SQUARED THEN there cannot possibly be a collision and it is unnecessary to use the separating axis theorem. |
||||
|
||||
![]() EMeythaler Member since: 10/16/2008 From: Casselberry, FL, United States |
||||
|
|
||||
| A quick addition: If you're using the Separating Axis Theorem for any kind of physics simulation, then you need to actually project the points onto the separation axes as my article instructs you to. However, if you're just using the Separating Axis Theorem for true or false collision detection, then you can substitute a quick dot product for the projection and dot product section of the algorithm. Basically, instead of projecting each point onto the axis and then looking for overlap using the min and max dot product of the projected points and the axis onto which they were projected, you could just look for overlap using the min and max dot product of the original points and the axis. This would speed the algorithm up, as the dot product is quite a bit cheaper than the projection. We would need the actual projection if we were doing physics with this algorithm. However, for simple collision detection, the dot product would be enough. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|