DuckQueen
DuckQueen

Reputation: 802

What is 3d vector with AABB Box intersection true/false detection algorithm?

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

Answers (1)

JWWalker
JWWalker

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

Related Questions