Reputation: 802
Say we have a AABB (Axis Aligned Bounding Box) defined via 2 min/max vectors P, Q of form [x,y,z], and a vector R we try to intersect with it, of same form. Origins of the vectors P, Q, and R are at the same point, [0,0,0]. How to detect whether R intersects AABB? Result may be true or false – intersection points are not needed.
Upvotes: 0
Views: 1610
Reputation: 22707
What one normally wants to do is intersect a ray, not a vector, with an AABB. I'm not sure what it would mean to intersect a vector with an AABB, maybe a finite section of a ray, in which case a ray-AABB algorithm would probably solve it for you. See Andrew Woo's "Fast Ray-Box Intersection" in the book "Graphics Gems". The program code is available online.
Upvotes: 0