Animating Water

An Implementation by Richard Resnick
CS563

Introduction

Most computer graphics people are firm believers in the power of real-world models. Our task is to animate water; our strategy is to simulate its behavior over time.

Water behaves according to a set of very simple rules. Each molecule in a body of water can be tracked, its motion predicted over time. Coarser levels of granularity suggest that way may be able to model water without simulating the behavior of every single molecule in that body.

Our Method

The method used in this implementation was suggested by James O'Brien and Jessica Hodgins in their paper, "Dynamic Simulation of Splashing Fluids." Some of this work had already been done by previous scientists, and interested readers are referred to their bibliography.

Our approach is relatively straightforward. We intend to model a pool of water by dividing that pool into a series of columns of water. Each column has an associated height. Water from one column can flow into another column, and does so according to the height difference between the two columns.

More specifically, we say that each of these vertical columns stands alone, disconnected from all of the other columns except by a virtual pipe from itself to each of it's eight neighbors:

We then model the flow of each column of water according to the laws of physics which we observe every day. Interested readers are referred to the paper "Dynamic Simulation of Splashing Fluids," referenced below.

Implementation Pipeline

A C program was written to simulate the columns of water in the pool. The behavior of the water was stored as a 2 dimensional array of heights. This array was then converted into a three-dimensional volume where, at each point (x,y,z), the value was either 0 to signify water at that point, or 1 to signify air.

This volume was then output in a vtk (Visualization Toolkit) format. A vtk program was created to perform the isosurface of the volume. This process was repeated for each of the time steps of the simulation, creating a time series of ppm files which were then joined together in MPEG format for viewing.

Animations

Top view, 30 frames, plug pulled from corner.
Side view, 70 frames, plug pulled from corner.
Top view, 70 frames, plug pulled from corner.

Top view, 70 frames, empty pool being filled from 4 corners.
Side view, 70 frames, empty pool being filled from 4 corners.

Top view, 70 frames, Large object dropped in center of pool.
Side view, 70 frames, Large object dropped in center of pool.
Top view, 70 frames, Large object dropped in center of slightly larger pool.

References

O'Brien, James F., and Hodgins, Jessica K. "Dynamic Simulation of Splashing Fluids." In Proceedings of Computer Animation '95, Geneva, Switzerland, 1995.

Back to the CS563 1997 Presentations Page