i
i
i
i
i
i
i
i
716 28. Spatial-Field Visualization
The solution to a cubic polynomial is discussed in Cubic and Quartic Roots
(Schwarze, 1990). His code is available on the web in several Graphics Gems
archive sites. Two modifications are needed to use it: linear solutions (his code
assumes A is non-zero), and the EQN
EPS parameter is set to 1.0e-30, which
provided for maximum stability for large coefficients.
28.2.2 Direct Volume Rendering
Another way to create a picture of a 3D scalar field is to do a 3D random density
plot using small opaque spheres. To avoid complications, the spheres can be made
a constant color and, in effect, they are light emitters with no reflectance. Such
a random density plot can be implemented directly using ray tracing and small
spheres, or with 3D points using a traditional graphics API. As in 2D, we can
take the limit as the sphere size goes to zero. This yields a 3D analog of the
pseudocolor display and is usually called direct volume rendering (Levoy, 1988;
Drebin et al., 1988; Sabella, 1988; Upson & Keeler, 1988).
There are two parameters that affect the appearance of a volume rendering:
sphere color, and sphere density. These are controlled by a user-specified transfer
function:
color = c(ρ),
number density = d(ρ).
Here the number density is the number of spheres per unit volume. If we assume
that the spheres have a small cross-sectional area a, and we consider a region
along the line of sight that is of a small thickness Δs such that no spheres appear
to overlap (Figure 28.10), then the color is
Figure 28.10. Athinslab
filled with opaque spheres.
L(s +Δs)=(1− F )L(s)+Fc,
where F is the fraction of the disk that is covered by spheres as seen from the
viewing direction. Because the disk is very thin, we can ignore spheres visually
overlapping, so this fraction is just the total cross-sectional area of the spheres
divided by the area A of the disk:
F =
daA Δs
A
= daΔs,
which yields
L(s +Δs)=(1−da Δs)L(s)+daΔsc.