Graphics Reference
In-Depth Information
Specify h(t=0), h(t=1), and b
for j=2 . . . n
to simulate sinks and sources, modify appropriate h values
calculate d from h(j-1) and b; if hi < bi, then di=0
use Equation 8.10 (Equation 8.13) to calculate h(j) from h(j-1) and
h(j-2)
adjust the values of h to conserve volume (as discussed above)
if hi < bi, set hi(j) and hi 1(j) to bi e
FIGURE 8.9
Two-dimensional algorithm for water transport.
Volume preservation can be compromised when h i <b i . To compensate for this, search for
the connected areas of water ( h j <b j
, iþn ) at each iteration and compute the
volume. If the volume changes from the last iteration. then distribute the difference among the
elements of that connected region. The algorithm for the two-dimensional case is shown in
Figure 8.9 .
Extending the algorithm to the three-dimensional case considers a two-dimensional height field.
The computations are done by decoupling the two dimensions of the field. Each iteration is decom-
posed into two subiterations, one in the x -direction and one in the y -direction.
for
j¼i ,
iþ1 ,
...
Summary
Animating all of the aspects of water is a difficult task because of water's ability not only to change
shape but also to change its topology over time. Great strides have been made in animating individual
aspects of water such as standing waves, ocean waves, spray, and flowing water. But an efficient
approach to an integrated model of water remains a challenge.
8.1.2 Modeling and animating clouds
Most any outdoor daytime scene includes some type of clouds as a visual element. Clouds can form a
backdrop for activity in the foreground, in which case they may be slow moving or even still. Clouds
can be used as an area of activity allowing planes to fly around or through them or, as fog, cars to drive
through them. Clouds viewed from afar have certain characteristics that are much different from clouds
that are viewed close up. From a distance, they exhibit high level opaque appearance features that trans-
parently disappear upon inspection at a closer distance. Cloud formations can inspire, impart calm, be
ominous and foreboding, or produce magnificent sunsets. Distant clouds can have a puffy opaque
appearance, often resembling familiar shapes of, for example, various animals or other common
objects. Other clouds have a layered or fibrous appearance. While some cloud formations viewed from
a distance might appear as a stationary backdrop or slow moving rigid formations, storm clouds can
 
Search WWH ::




Custom Search