6 r . w. s u mn er, j . f . o Õb rien , a n d j. k . h odg in s / a n im...

1

Upload: others

Post on 14-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 6 R . W. S u mn er, J . F . O ÕB rien , a n d J. K . H odg in s / A n im …job/Classes/CS184/Fall... · 2014-12-01 · If pa rticles are on ly gene ra te d at the b eginni ng of

6 R. W. Sumner, J. F. O’Brien, and J. K. Hodgins / Animating Sand, Mud, and Snow

Figure 7: The left figure shows the ground area that has been created in the hash table. The currently active areais highlighted in red. The right figure shows the same scene rendered over the initial ground surface. There areapproximately 37,000 columns in the active area and 90,000 stored in the hash table; the number of columns inthe entire virtual grid is greater than 2 million.

The initial position, p0, for a particle is randomlydistributed over the surface of the triangle accordingto:

p0 = baxa + bbxb + bcxc (4)

where xa, xb, and xc are the coordinates of the verticesof the triangle and ba, bb, and bc are the barycentriccoordinates of p0 given by

ba = 1.0 −√ρa (5)

bb = ρb(1.0 − ba) (6)

bc = 1.0 − (ba + bb) (7)

where ρa and ρb are independent random variablesevenly distributed between [0..1]. This computationresults in a uniform distribution over the triangle28 .

The initial velocity of a particle is computed fromthe velocity of the rigid object:

p0 = + × p0 (8)

where and are the linear and angular velocityof the object. To give a more realistic and appealinglook to the particle motion, the initial velocities arerandomly perturbed.

The final component of the particle creation algo-rithm accounts for the greater probability that mate-rial will fall off rapidly accelerating objects. A particleis only created if (|p0|/s)γ > ρ, where s is the min-imal acceleration at which all potential particles willbe dropped, γ controls the variation of the probabil-ity of particle creation with speed, and ρ is a randomvariable evenly distributed in the range [0..1].

If particles are only generated at the beginning ofa time step then the resulting particle distribution

will have a discrete, sheetlike appearance. We avoidthis undesirable effect by randomly distributing eachparticle’s creation time within the time step interval.The information used to calculate the initial positionand velocity is interpolated within the interval to ob-tain information appropriate for the particle’s creationtime.

Once generated, the particles fall under the influ-ence of gravity. When a particle hits the surface of acolumn, its volume is added to the column.

3.3. Implementation and Optimization

Simulations of terrain generally span a large area. Forexample, we would like to be able to simulate a run-ner jogging on a beach, a skier gliding down a snow-covered slope, and a stampede of animals crossing asandy valley. A naive implementation of the entire ter-rain would be intractable because of the memory andcomputation requirements. The next two sections de-scribe optimizations that allow us to achieve reason-able performance by storing and simulating only theactive portions of the surface and by parallelizing thecomputation.

Algorithm Complexity. Because the ground modelis a two-dimensional rectilinear grid, the moststraightforward implementation is a two-dimensionalarray of nodes containing the height and other infor-mation about the column. If an animation requireda grid of i rows and j columns, i × j nodes wouldbe needed, and computation time and memory wouldgrow linearly with the number of grid points. Thus,a patch of ground 10 m × 10 m with a grid resolu-tion of 1 cm yields a 1000×1000 grid with one million

c© The Eurographics Association 1999