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

Does f represent the equations below each example? If so which variable is substituted by p? I'm looking back and forth between this and the previous slide and can't tell how p is involved with these equations.

Staffpsmanohar

Good question! Yes, ff is the equation. So in the case of the sphere, f(x,y,z)=x2+y2+z21f(x,y,z) = x^2 + y^2 + z^2 - 1, and the surface contains all points (a,b,c)(a,b,c) such that f(a,b,c)=0f(a,b,c) = 0. Remember that a point p\mathbf{p} or r(t)\mathbf{r}(t) is a vector, so it contains an xx, yy, and zz component. For example, if you have a ray r(t)=(1,1,0)+t(1,2,3)\mathbf{r}(t) = (-1, 1, 0) + t(1, 2, 3), then when you plug in f(r(t))f(\mathbf{r}(t)) you get f(1+t,1+2t,3t)f(-1 + t , 1 + 2 t, 3 t), which is now a (univariate!) polynomial in tt. The tt's which satisfy this polynomial give you the intersection points of the ray with the implicit surface.

Carpetfizz

Are planes and spheres the only non-implicit surfaces we can do a ray-intersection test with? What if I wanted to test intersection with an ellipsoid? I can't necessarily use the intersection with a sphere, and I may not have the implicit surface equation either.

surelywang

@Carpetfizz

Hi! I did some researching online and it seems we can in fact do a ray-intersection test with an ellipsoid, by scaling it to a sphere.

Here is a resource you can look at (page 18): https://cs.oberlin.edu/~bob/cs357.08/VectorGeometry/VectorGeometry.pdf

Staffirisli

I Googled for the heart and found a whole bunch of other cool shapes: https://imaginary.org/sites/default/files/imaginary-posterset-english-version1_0.pdf

I'd imagine that it'd be possible to do ray intersections with all of these right?

You must be enrolled in the course to comment