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, f is the equation. So in the case of the sphere, f(x,y,z)=x2+y2+z2−1, and the surface contains all points (a,b,c) such that f(a,b,c)=0. Remember that a point p or r(t) is a vector, so it contains an x, y, and z component. For example, if you have a ray r(t)=(−1,1,0)+t(1,2,3), then when you plug in f(r(t)) you get f(−1+t,1+2t,3t), which is now a (univariate!) polynomial in t. The t'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
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.
Good question! Yes, f is the equation. So in the case of the sphere, f(x,y,z)=x2+y2+z2−1, and the surface contains all points (a,b,c) such that f(a,b,c)=0. Remember that a point p or r(t) is a vector, so it contains an x, y, and z component. For example, if you have a ray r(t)=(−1,1,0)+t(1,2,3), then when you plug in f(r(t)) you get f(−1+t,1+2t,3t), which is now a (univariate!) polynomial in t. The t's which satisfy this polynomial give you the intersection points of the ray with the implicit surface.
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.
@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
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?