Frog and Pond Animation |
Ray-Traced Water Animation |
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.
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.
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.
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.
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.
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.