Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Endemoniada

Closest Distance Between Line Segments ?

This topic is 5490 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 guys, My collision detection system is almost perfect but some weird things happen sometimes, I think if I can figure this out I can fix it. Can I determine the closest distance two line segments come to each other ? I don''t need to know where the closest point is, just the closest distance. The line segments are in 2D and can be facing in any direction. I know how to find the closest distance that one point is to a line segment but not a line segment to another line segment. Thanks again. PS- when I get my game done I''m gonna give a "Special Thanks" to gamedev :o)

Share this post


Link to post
Share on other sites
Advertisement
off the top of my head, express the lines in vector form in terms of two parameters lamda and mu, find the distance between two general points and minimise this with respect to lamda and mu

Share this post


Link to post
Share on other sites
http://geometryalgorithms.com/Archive/algorithm_0106/algorithm_0106.htm

but please, use google

David

Share this post


Link to post
Share on other sites

  • 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!