dilevin / computer-graphics-bounding-volume-hierarchy

Computer Graphics Assignment about Bounding Volume Hierarchies
6 stars 7 forks source link

ray_intersect_box special cases #104

Open Kushagra-Raghuvanshi opened 2 weeks ago

Kushagra-Raghuvanshi commented 2 weeks ago

careful: if the ray or min_t lands inside the box this could still hit something stored inside the box, so this counts as a hit

From what i get we need to (i) check for ray's origin being inside the box, but In this what is meant by (ii) checking for min_t being inside the box, since min_t is just a double not a 3d point? do they mean point at parametric distance min_t?

Zhecheng-Wang commented 2 weeks ago

See lecture slides or book on how to check box ray intersection, but basically, it computes a t for every dimension. Then we take $(([min_t,max_t] \cap [tmin(0),tmax(0]) \cap [tmin(1),tmax(1)]) \cap [tmin(2),tmax(2)]$ to check if the interval $[min_t, max_t]$ intersects with the box. This implicitly checks if min_t is inside the box.