5

I using C# and XNA. I need an algorithm in any language to obtain the border intersection point(s) of a rectangle with a 2d segment.

I've been looking for an answer for my question for over 3 hours already and couldn't find a solution that works.

Can anyone help me please?

Thanks a lot.

  • Possibly related: http://stackoverflow.com/questions/1585525/how-to-find-the-intersection-point-between-a-line-and-a-rectangle – vcsjones Sep 10 '11 at 22:17

1 Answers1

4

You can find an example for a line segment intersection with an aabb box here.

Or the same question as your question here

Community
  • 1
  • 1
Fox32
  • 13,126
  • 9
  • 50
  • 71