Jump to content
  • Advertisement

Archived

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

yanuart

2D lines intersection

This topic is 5918 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

For ex. I have 2 lines in 2D, Line1 (x1,y1)-(x2,y2) and Line2(a1,b1)-(a2,b2) how do I know if those two intersect ?? I''m trying to apply this so that I know if for ex. wether a movement will cross a line or not, and I mean crossing and not colliding, let''s say I''m checking wether a person is crossing a police line or not and I''m not saying that a person can''t, but if the person does then the police will be alerted or something like that.. thx..

Share this post


Link to post
Share on other sites
Advertisement
this is still a collision detection problem. just becuase when you detect a collision you are not preventing the object from passing through does not change how you detect it.

do a search for a line intersection formula. check your math book, or the net. this is something that should have been posted in the math and physics forum (because its a math problem). dont post there now, because i have given you the answer you need. google wil give you plenty of information.

Share this post


Link to post
Share on other sites
a person is quite right, this is definately not the forum for this, Math and Physics or For Beginners would be the place to post.

And before you tried posting there you should try looking for the information yourself (asking other people to do your work and you'll never learn anything), using Google and the search terms Line Intersection, the first link it returned was Line-Line Intersection - From MathWorld, which has lots of pretty pictures to make it easy to understand the algorithm. In future try Google, put whatever you want into the little box and see what it gives you. If you're still stuck come here and post to the right forum. You will save alot of time this way.

[edited by - Michalson on May 6, 2002 5:11:52 PM]

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!