180 likes | 197 Views
Making waves. Alain Fournier, UBC. Making Waves: What is the goal. Computable model Geometry in familiar form Realistic shape Realistic motion Depth effect, refraction, wind effects Foam, spray Level of details, control of complexity. What the model is not. Stochastic A fractal
E N D
Making waves Alain Fournier, UBC
Making Waves: What is the goal • Computable model • Geometry in familiar form • Realistic shape • Realistic motion • Depth effect, refraction, wind effects • Foam, spray • Level of details, control of complexity
What the model is not • Stochastic • A fractal • A height field • Net transport of water • A physical model
Previous and following work • Nelson Max’ Carla’s Island (‘81) • Ken Perlin’s noise (‘85) • Darwin Peachey’s waves (‘86) • Ts’o and Barsky (‘85) • Musgrave, Foster, Metaxas, and many dynamic models.
The basic model • Lagrangian: a grid is created and each grid point moves, but relationship is kept • Each point moves in a circular orbital: x = x0+ r sin(k x0 - w t ) z = z0 - r cos(k x0 - w t )
Parametric equation For t = 0 and z0 = 0 x = -a / k - r sin (a) z = - r cos(a) where a = - k x0
Wave characteristics • Height H = 2r • Wavelength L = 2 p / k • Period T = 2 p / w • Phase speed c = L/T = w / k (eg speed at which crest travels)
Shape parameter • Steepness of the wave H/L is the shape parameter • H/L = k r / p
Some relationships L = g T2 / 2 p (in deep water) c = g T / 2 p (in deep water) • Group velocity U = c/2 (speed at which energy carried travels) • If average wind speed is V, under some conditions: H = 7.065* 10-3 *V 2.5
Special effects • Go to 2D (wave direction) • Put “wind effect” (speed up orbital at top, slow down at bottom) l • Depth effect at depth h: k tanh(k h ) = k0 k0 is k at infinite depth • can be approximated by k = k0 / sqrt( tanh (k0 h))
Effects of effects • l (wind effect) affects shape • k (depth effect) affects wavelength, therefore phase speed, so causes refraction • depth effect has to be cumulative over depth “history” of wave
Breakers, spray and foam • Particle speed greater than phase speed • Curvature has to be high • In model, particle (foam) is generated is curvature above threshold, leaves the wave (spray) if speed is above threshold. • Direction and speed of spray is known
Trains • Wave train is group of waves with same characteristics • Implemented as rectangular boxes with same height, period, wavelength, direction and its own speed. • For fun also has height envelope and holes to introduce more variations
Trains (continued) • Trains actually have their own grid (usually rather low resolution, eg 5x5 or 10x10) to gather own information (such as depth history) • Time decay effect can be introduced • Trains can be backed up for initialization • Train files describe several trains.
Height data • Some built-in (slope, platform, funnels) • Some imported (will be adjusted to size of wave grid)
Rendering • You’re on your own • Still to get nice foam and spray • Speed? Nor worse than basic terrain object
Conclusions • Well, you’ve got waves • It’s pretty simple • It’s quite flexible • It can look good • It’s fairly adaptable (OK, very adaptable).