3.5 Other Quadrics

pbrt supports three more quadrics: cones, paraboloids, and hyperboloids. They are implemented in the source files shapes/cone.h, shapes/cone.cpp, shapes/paraboloid.h, shapes/paraboloid.cpp, shapes/hyperboloid.h, and shapes/hyperboloid.cpp. We won’t include their full implementations here, since the techniques used to derive their quadratic intersection coefficients, parametric coordinates, and partial derivatives should now be familiar. However, we will briefly summarize the implicit and parametric forms of these shapes. A rendered image of the three of them is in Figure 3.10.

Figure 3.10: The Remaining Quadric Shapes. From left to right: the paraboloid, the hyperboloid, and the cone.

3.5.1 Cones

The implicit equation of a cone centered on the z axis with radius r and height h is

left-parenthesis StartFraction h x Over r EndFraction right-parenthesis squared plus left-parenthesis StartFraction h y Over r EndFraction right-parenthesis squared minus left-parenthesis z minus h right-parenthesis squared equals 0 period

Cones are also described parametrically:

StartLayout 1st Row 1st Column phi 2nd Column equals u phi Subscript normal m normal a normal x Baseline 2nd Row 1st Column x 2nd Column equals r left-parenthesis 1 minus v right-parenthesis cosine phi 3rd Row 1st Column y 2nd Column equals r left-parenthesis 1 minus v right-parenthesis sine phi 4th Row 1st Column z 2nd Column equals v h period EndLayout

The partial derivatives at a point on a cone are

StartLayout 1st Row 1st Column StartFraction partial-differential normal p Over partial-differential u EndFraction 2nd Column equals left-parenthesis minus phi Subscript normal m normal a normal x Baseline y comma phi Subscript normal m normal a normal x Baseline x comma 0 right-parenthesis 2nd Row 1st Column StartFraction partial-differential normal p Over partial-differential v EndFraction 2nd Column equals left-parenthesis minus StartFraction x Over 1 minus v EndFraction comma minus StartFraction y Over 1 minus v EndFraction comma h right-parenthesis comma EndLayout

and the second partial derivatives are

StartLayout 1st Row 1st Column StartFraction partial-differential squared normal p Over partial-differential u squared EndFraction 2nd Column equals minus phi Subscript normal m normal a normal x Superscript 2 Baseline left-parenthesis x comma y comma 0 right-parenthesis 2nd Row 1st Column StartFraction partial-differential squared normal p Over partial-differential u partial-differential v EndFraction 2nd Column equals StartFraction phi Subscript normal m normal a normal x Baseline Over 1 minus v EndFraction left-parenthesis y comma negative x comma 0 right-parenthesis 3rd Row 1st Column StartFraction partial-differential squared normal p Over partial-differential v squared EndFraction 2nd Column equals left-parenthesis 0 comma 0 comma 0 right-parenthesis period EndLayout

3.5.2 Paraboloids

The implicit equation of a paraboloid centered on the z axis with radius r and height h  is

StartFraction h x squared Over r squared EndFraction plus StartFraction h y squared Over r squared EndFraction minus z equals 0 comma

and its parametric form is

StartLayout 1st Row 1st Column phi 2nd Column equals u phi Subscript normal m normal a normal x Baseline 2nd Row 1st Column z 2nd Column equals v left-parenthesis z Subscript normal m normal a normal x Baseline minus z Subscript normal m normal i normal n Baseline right-parenthesis 3rd Row 1st Column r 2nd Column equals r Subscript normal m normal a normal x Baseline StartRoot StartFraction z Over z Subscript normal m normal a normal x Baseline EndFraction EndRoot 4th Row 1st Column x 2nd Column equals r cosine phi 5th Row 1st Column y 2nd Column equals r sine phi period EndLayout

The partial derivatives are

StartLayout 1st Row 1st Column StartFraction partial-differential normal p Over partial-differential u EndFraction 2nd Column equals left-parenthesis minus phi Subscript normal m normal a normal x Baseline y comma phi Subscript normal m normal a normal x Baseline x comma 0 right-parenthesis 2nd Row 1st Column StartFraction partial-differential normal p Over partial-differential v EndFraction 2nd Column equals left-parenthesis z Subscript normal m normal a normal x Baseline minus z Subscript normal m normal i normal n Baseline right-parenthesis left-parenthesis StartFraction x Over 2 z EndFraction comma StartFraction y Over 2 z EndFraction comma 1 right-parenthesis comma EndLayout

and

StartLayout 1st Row 1st Column StartFraction partial-differential squared normal p Over partial-differential u squared EndFraction 2nd Column equals minus phi Subscript normal m normal a normal x Superscript 2 Baseline left-parenthesis x comma y comma 0 right-parenthesis 2nd Row 1st Column StartFraction partial-differential squared normal p Over partial-differential u partial-differential v EndFraction 2nd Column equals phi Subscript normal m normal a normal x Baseline left-parenthesis z Subscript normal m normal a normal x Baseline minus z Subscript normal m normal i normal n Baseline right-parenthesis left-parenthesis minus StartFraction y Over 2 z EndFraction comma StartFraction x Over 2 z EndFraction comma 0 right-parenthesis 3rd Row 1st Column StartFraction partial-differential squared normal p Over partial-differential v squared EndFraction 2nd Column equals minus left-parenthesis z Subscript normal m normal a normal x Baseline minus z Subscript normal m normal i normal n Baseline right-parenthesis squared left-parenthesis StartFraction x Over 4 z squared EndFraction comma StartFraction y Over 4 z squared EndFraction comma 0 right-parenthesis period EndLayout

3.5.3 Hyperboloids

Finally, the implicit form of the hyperboloid is

x squared plus y squared minus z squared equals negative 1 comma

and the parametric form is

StartLayout 1st Row 1st Column phi 2nd Column equals u phi Subscript normal m normal a normal x Baseline 2nd Row 1st Column x Subscript r 2nd Column equals left-parenthesis 1 minus v right-parenthesis x 1 plus v x 2 3rd Row 1st Column y Subscript r 2nd Column equals left-parenthesis 1 minus v right-parenthesis y 1 plus v y 2 4th Row 1st Column x 2nd Column equals x Subscript r Baseline cosine phi minus y Subscript r Baseline sine phi 5th Row 1st Column y 2nd Column equals x Subscript r Baseline sine phi plus y Subscript r Baseline cosine phi 6th Row 1st Column z 2nd Column equals left-parenthesis 1 minus v right-parenthesis z 1 plus v z 2 period EndLayout

The partial derivatives are

StartLayout 1st Row 1st Column StartFraction partial-differential normal p Over partial-differential u EndFraction 2nd Column equals left-parenthesis minus phi Subscript normal m normal a normal x Baseline y comma phi Subscript normal m normal a normal x Baseline x comma 0 right-parenthesis 2nd Row 1st Column StartFraction partial-differential normal p Over partial-differential v EndFraction 2nd Column equals left-parenthesis left-parenthesis x 2 minus x 1 right-parenthesis cosine phi minus left-parenthesis y 2 minus y 1 right-parenthesis sine phi comma left-parenthesis x 2 minus x 1 right-parenthesis sine phi plus left-parenthesis y 2 minus y 1 right-parenthesis cosine phi comma z 2 minus z 1 right-parenthesis comma EndLayout

and

StartLayout 1st Row 1st Column StartFraction partial-differential squared normal p Over partial-differential u squared EndFraction 2nd Column equals minus phi Subscript normal m normal a normal x Superscript 2 Baseline left-parenthesis x comma y comma 0 right-parenthesis 2nd Row 1st Column StartFraction partial-differential squared normal p Over partial-differential u partial-differential v EndFraction 2nd Column equals phi Subscript normal m normal a normal x Baseline left-parenthesis minus StartFraction partial-differential normal p Subscript y Baseline Over partial-differential v EndFraction comma StartFraction partial-differential normal p Subscript x Baseline Over partial-differential v EndFraction comma 0 right-parenthesis 3rd Row 1st Column StartFraction partial-differential squared normal p Over partial-differential v squared EndFraction 2nd Column equals left-parenthesis 0 comma 0 comma 0 right-parenthesis period EndLayout