Separation Axis Theorem - Little help please

Started by
1 comment, last by chicken90 15 years, 11 months ago
Hi everyone. I'm new :) And I hope you can help me a little bit. I'm currently trying to figure out how the SeparationAxisTheorem works. I found a tutorial here: http://www.harveycartel.org/metanet/tutorials/tutorialA.html This helped me, but I still got questions I can't find any answers for (even with help of all-mighty-Google). So I explain how I understood the steps for finding a separation plane for two rectangles: At first I need to find the edges perpendiculars, so I substract the vectors that build the edges and flip the fraction and multiply it by -1 (sorry don't know the english word for that kind of fraction, in germany we call it 'Kehrbruch' ^^). Ok, now I know that I have to project the rectangle's vectors on the perpendicular, with this term: Projection A onto B DotProduct = A.X * B.X + A.Y * B.Y Proj.X = DotProduct / (B.X * B.X + B.Y * B.Y) * B.X Proj.Y = DotProduct / (B.X * B.X + B.Y * B.Y) * B.Y Are these terms right? Ok, now all I need to know is which vectors I have to project. All for each rectangle? And then, how do I go on? I have to test if the vectors cross on the perpendicular, but how do I do this? I would really appreciate your help, cause I'm really going mad on figuring this out. .ch!cken :)
Advertisement
http://gpwiki.org/index.php/VB:Tutorials:Building_A_Physics_Engine:Basic_Intersection_Detection
Ok, thanks for the link. I'm goging to figure this out tomorrow and hope I get it working. Otherwise I will return here :)

Thank you ;-)

Ok, I just found time to write the code now, and it WORKS! Thank you so damn much :)
I spent hours trying to figure it out, and now, the tutorial worked for me :)
Thank you!

[Edited by - chicken90 on May 25, 2008 2:09:52 PM]

This topic is closed to new replies.

Advertisement