Physically-based Character Animation and Dynamic Water Simulation


Frog and Pond Animation

Ray-Traced Water Animation

Physically-based Character Animation

Motivation

In our original animation project, our character (Mr. Froggy) hops off and on a lily pad, chased away by a rain cloud. We wanted to make the jumping look more realistic, both by adding squash and stretch, and by basing his vertical motion in a physical system. The first version used simple translations to make him hop. This version uses forces to control his motion and springs to control his legs and the squash/stretch factor.

Vertical Forces

To make the motion of Mr. Froggy in the air look more realistic, he is given an initial upward force. This is added to gravity, which eventually returns him back to earth. The upward force is parameterized by the "hop" variable and the "hop angle" variable; the former controls the height of the jump and the latter controls the distance from the vertical. To actually make him jump sideways, we set the "side" variable, which changes the magnitude of the force in the x direction.

When Mr. Froggy lands on the lily pad, we wanted the water to react with ripples or a splash, depending on how high he had jumped. The lily pad force is based on the vertical force applied to the frog when he is on the lily pad. Thus, there is a small splash when he takes off (because he exerts a downward force to be able to jump upward), and a bigger splash when he lands.

Springy Legs

Another portion of the physical-based animation was to make Mr. Froggy's legs absorb the impact of his jump (and also apply force on the take off). Originally we made two springs to control the legs, one for the angle between the torso and the upper leg, and one for the angle between the upper leg and the lower leg. This model turned out to be overly complicated and also didn't look very good. Mr. Froggy's feet were sliding inward and outward after he had landed. To look more realistic, we needed to make his feet "stick" on the landing. But it appeared the only way to accomplish this was by tweaking the spring and damp constants for each angle. Of course, this resulted in other undesirable artifacts.

To finally fix the sliding feet problem, we applied inverse kinematics. Once Mr. Froggy lands, his foot angle is dictated by the other two angles in the model. However, once we worked out the equations for making the feet stick, it became apparent that we didn't need two separate springs for each angle. In fact, just by knowing the appropriate angle between the torso and the upper leg, we could determine what the other angle ought to be. This improvement simplified the program code and made the resulting animation look much better.

Squash and Stretch

We implemented one last simple effect to make the animation look more realistic - squash and stretch. Mr. Froggy starts out as a sphere, and at all times he maintains the same volume. How that volume is distributed is based on the amount of compression or extension in his leg springs. Also, the squash/stretch effect decreases the more he is extended. So the exaggeration is most noticeable when he first jumps or lands; as the spring extends further, he does not stretch very much more. This softening effect, those fairly easy to implement, greater increases the visual appeal of the animation.

Water Simulation

We also augmented our frog's universe with a dynamic water model that can produce waves and splashes. The basic model was taken from O'Brien and Hodgins [1]. It consists of a grid of water columns of various heights, with equations relating the flow between columns to column heights. The model also contains methods for applying forces to the water surface (in our animation, via raindrops or the frog jumping on the lily pad), and for creating splashes. Below we sketch the model as we implemented it, including a few alterations we made in order to get the desirable “look” for our water animation.

The Basic Water Height Model

Many of the water models used in computer graphics today are based on simplified versions of the Navier Stokes fluid flow equations. Despite being simpler than the full Navier Stokes equations, these models can still be highly complex. Furthermore, because we were modeling only the water in a pond, the full generality of these models was unnecessary for our purposes. However, some of the simpler existing models that employed only bump-mapping were inadaquate for our purposes, because we wanted to show the profile of our pond, and we were also looking for additional effects such as splashes.

We chose to use a model due to O'Brien and Hodgins that treats bodies of water as a grid of vertical columns with variable heights [1]. Flows between the columns are represented as a series of pipes -- the figure below shows a piece of the water grid, with the pipes to and from the center water column shown (other pipes are omitted):

The model starts by assuming that the pressure of a column of liquid is proportional to its height (valid if the water is not moving too rapidly), and that the acceleration of flow across a pipe is constant for some interval of time. With these assumptions, the flow of water is given by:

The damping factor on the velocity of water was not included in [1], we added it to alleviate problems with persistent water spikes. In our work a very small amount of damping (i.e. damping coefficient very close to 1, we used ~.995) was sufficient to calm the system adaquately.

Forces on the Water Surface

The equations above include terms for downward forces on the water. In our model, we had two types of events that could cause downward water forces -- rain or splash particles hitting the water, and the frog jumping on the lily pad. We modeled rain particle collisions as a one-time-step force proportional to the particle's mass times its velocity at impact. We modeled the frog jumping as as uniform force across the area of the lilypad, equal to the downward force exerted by the frog. For aesthetic reasons, we ended up dividing the force due to the frog by 2.0 to get more reasonable looking waves and splashes.

Splashes

Our splash model involved spawning particles when the vertical velocity of a column passed a threshold. The upward velocity of the spawned particles was equal to the upward velocity (y dimension) of the water column divided by the particle's mass, while the velocity in the x- and z-dimensions was proportional to the sum of the water flow through the pipes in the x- and z-directions, respectively. This method of obtaining the particle's velocity was slightly different than that given in [1].

References

[1] O'Brien, J. F., Hodgins, J. K., 1995. Dynamic Simulation of Splashing Fluids. Proceedings of Computer Animation `95, Geneva Switzerland, April 19-21, pp 198-205.
[2] Witkin, Andrew, 1997. Physically Based Modeling: Principles and Practice. SIGGRAPH 1997 Course Notes.