Intersection of line segment with axis-aligned box in C#

后端 未结 3 1359
梦毁少年i
梦毁少年i 2020-12-17 02:16

I\'m looking for an algorithm that determines the near and far intersection points between a line segment and an axis-aligned box.

Here is my method definition:

3条回答
  •  隐瞒了意图╮
    2020-12-17 03:02

    Well, for an axis-aligned box it's pretty simple: you have to find intersection of your ray with 6 planes (defined by the box faces) and then check the points you found against the box vertices coordinates limits.

提交回复
热议问题