You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 9: Raytracing (34)
cedricnixon

We should know the ray misses the box when the intersection of the (t_min, t_max) intervals is empty (in other words, they have no overlap).

zehric

Also mentioned in lecture is the edge case where there is no overlab but the ray hits the exact corner of the rectangle.

michaeltu1

What can we do if the ray misses the box?

michaeltu1

How are we choosing the origin and direction of each ray?

jenzou

To michaeltu1: if the ray misses the box, then we know there's no object that the ray could intersect with. This is assuming we have defined the bounding box correctly to enclose the entire object.

jenzou

Also to michaeltu1: I think we are choosing the origin and direction of each ray based on slide 14 https://cs184.eecs.berkeley.edu/sp19/lecture/9-14/raytracing So the origin is at the eye, and the direction is perpendicular to the particular pixel we are shooting the ray through?

serser11

What if the object is no longer a box and the ray can intersect with the edges multiple times (i.e. more than twice)? From my understanding tmin is the first intersection with the object and tmax is the last intersection with the object. Correct me if I am wrong.

serser11

However, also, do we need to care for the case that the object is no longer a box? Is it always a box? In other words, what is the box representing now, is it a small section of the grid?

go-lauren

I'm not sure I'm totally convinced here. In the 3D case, I think it is definitely possible for a ray to first intersect two planes and be in the box and be outside the box when it intersects the third. Wouldn't that violate taking the max t_min value?

spopat

I'm a little confused about this statement in lecture: if the interval goes backwards or the interval is entirely behind the ray’s origin (in the negative t direction), then the ray doesn’t intersect the box at all. How would the interval end up behind the origin?

sirejdua

The negative interval refers to if you use the equation to compute the intersection with a plane on the next slide, the intersection time is (p'x-ox)/dx. if the plane appears behind the ray, then the numerator is negative, and you get a negative t. This can result in an interval that is negative, so you can interpret this as the box being behind the ray.

MingweiSamuel

There's an interesting pathological edge case -- if the ray is parallel to one of the slabs (i.e. some component of o is zero), then a naive algorithm will usually work, dividing by zero and getting -inf -> +inf ... EXCEPT it might fail if the zero component of o is negative zero (-0.0) ... though for the sake of this project it seems its basically impossible to get the cameras to align precisely to zero, so it doesn't really matter.

xiaoyankang

Found detailed explanation for ray-box intersection on this: https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection

glee-

To answer @spopat: Notice in the second image, where we can see t_min < 0. Notice where the two black points are; they are at the intersection of the ray and the slab (in this case y0 and y1). For the ray to hit the slab in y0, it would have to move backwards, giving us the conclusion that the ray cannot intersect the y0 plane.

You must be enrolled in the course to comment