Jump to content
  • Advertisement
Sign in to follow this  
chicken90

Separation Axis Theorem - Little help please

This topic is 3824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!