## Abstract

We provide a biologically motivated technique for modeling and animating bird flocks in flight, which produces plausible and realistic-looking flock animations. While most previous approaches have focused on animating cluster formations, this article introduces a technique for animating flocks that fly in certain patterns, so-called line formations. We distinguish between the behavior of such flocks during initiation and their behavior during steady flight. Our simulation of the initiation stage is rule-based and incorporates an artificial bird model. Our simulation of the steady-flight stage combines a data-driven approach and an energy-savings model.

## 1 Introduction

Researchers in biology and computer graphics have long been intrigued by the challenge of realistically modeling and animating groups of animals. One such example is the synchronized motion of flocks of birds, which is a delightful and fascinating sight. Flying flocks can be classified by their formation—as *cluster formations* or *line formations* [10]. In cluster formations, typical of small birds as well as fish and herds, the animals are organized in irregular shapes. In line formations the they are organized in a characteristic pattern, such as a line, V, or U. These formations are typically two-dimensional and exhibit a high degree of regularity in spacing and alignment. They are common in flocks of large birds, such as waterfowl, cranes, and pelicans.

In his groundbreaking article, Reynolds proposed animating groups by simulating the behavior of each bird independently [24]. The results are pretty animations of cluster flocks. Others have also addressed the animation of cluster formations [4, 12]. This article introduces a technique for realistically animating flocks of birds flying in line formations (Figure 1).

In nature, these flocks undergo two stages: flock *initiation* (also termed *formation*) and *steady flight*. Initiation occurs during takeoff, with many rapid changes in the locations of the birds within the flock. During steady flight the flock flies over large distances in more stable shapes. Previous approaches have not distinguished between these stages and have applied the same rules to the whole animation. While this strategy suffices for clusters, it does not suit the long, steady flights of flocks flying in line formations. We propose modeling these stages differently.

Why flocks fly long distances (up to 20,000 miles) in specific patterns is still a puzzle [2]. While it is often believed that the central rationale is to save energy [32], no model exists that can precisely predict the birds' positions. This lack of knowledge directed us to choose a data-driven approach, utilizing real examples of flying flocks, for animating the steady-flight stage. Since existing examples are typically very short, while the flight is extremely long, we augment these examples with calculations of possible energy savings. This combination is shown to produce not only feasible, but also eye-pleasing animations of flying bird flocks.

Inspired by previous work, our approach for animating the initiation stage is rule-based, where the behavior of each individual bird governs the motion of the whole flock. We introduce a new set of rules that better suits line formations. These rules are based on two novel drives, target-reaching and separation, which help us more accurately animate the flock in initiation.

Our contribution is hence threefold. First, we propose to distinguish between initiation and steady flight (Section 3). Second, we show how steady flight patterns can be produced by combining a data-driven approach with an energy-savings model (Section 5). Finally, we suggest a novel set of rules for the initiation stage of line-formation flocks (Section 6).

In http://www.ee.technion.ac.il/ayellet/Movies/10-KlotsmanTal.mpg, a video that demonstrates our results can be viewed.

## 2 Related Work

Most previous work on flock animation has focused on flocks flying in clusters. We briefly introduce that work. Then we present the prevailing biological hypotheses that attempt to explain why certain flocks fly in line-formation patterns and recall a couple of articles that animate such flocks.

### 2.1 Cluster Formations

Animation of group behavior—of humans and animals alike—has attracted a lot of attention in computer graphics [17, 18, 21, 24, 25, 27, 29–31]. We focus on bird flocks.

Heppner defined a *flock* as a group of flying birds characterized by coordination in one or more of the following flight parameters: turning, spacing, timing of takeoff and landing, and individual flight speed and direction [10]. In his seminal work, Reynolds proposed three rules for animating flocks: collision avoidance, velocity matching, and flock centering [24]. The aggregate flock motion is a result of the action of all the birds. In [12], stochastic differential equations are developed on the basis of four drives: homing, interaction, attempting to preserve a specific flight velocity, and randomness. In [23], it is proposed to model flocks by nonlinear dynamics. In [1] a technique is described for generating constrained group animations. In [4], fuzzy logic is introduced into flock modeling. This allows the model to use uncertain knowledge and linguistic descriptions. The results are estimated and shown to improve the results of [24] in some parameters.

These techniques exhibit pretty animations for cluster-shaped flocks. However, line-formation flocks are difficult to generate using these methods, since the rules employed tend to cluster the birds together. In [4], specific, but unrealistic initial conditions may produce line formations, but these are likely to break during the flight.

### 2.2 Line Formations

There are two main hypotheses explaining the tendency of birds to adopt a line formation: enhanced communication and aerodynamic energy savings [2]. According to the first hypothesis, these formations are the result of the visual requirements of line-formation flight. According to the second, a bird in a line formation can save energy by taking advantage of the wingtip vortices produced by the neighboring birds [11].

Without taking into account wing flapping, [19] predicts the optimal distances between the birds, which yield maximal energy savings. A specific U shape is shown to save energy equally for all the birds in the flock. In [13, 14, 26, 28], more elaborate and accurate power-reduction calculations are presented. Andersson and Wallander [2] suggest that small flocks containing related birds use V formations, where the leading birds save less energy.

Field studies, however, show a wide variation in spacing and in deviations from the above optimal positions. Some interpret these deviations as a failure of the birds to reach an optimal energy distribution [3, 9], while others view it as support for an alternative hypothesis [5, 8]. In [32], empirical evidence supports the energy-savings hypothesis: The heart rates of white pelicans were measured and significant energy savings shown for flocks flying in line formations. We adopt the energy-savings model, which is currently the dominant hypothesis.

In [7] it is proposed to add an additional rule to [24] in order to animate line-formation flocks. This rule keeps some portion of the bird's field of view unobstructed. This causes some of the birds to arrange into fragments of linear formations. Yet, such arrangements are local, and the convergence of the whole flock to a line formation is not guaranteed. In [22], three rules are introduced for animating the initiation stage: coalescing (seeking proximity to the nearest bird), gap-seeking (seeking the nearest position with an unobstructed view), and stationing (avoiding downwash regions). It is demonstrated that the flock converges to a line formation. However, the realism of the animation is not guaranteed, since the directions of the birds are not taken into account (e.g., a bird is assumed to fly forward, even when its position changes laterally).

We propose to solve these problems by providing a new set of rules for simulating the initiation and a novel data-driven approach, based on an energy-savings model, for animating steady flight, which has not been addressed before.

## 3 General Approach

In nature, during initiation and takeoff the positions and the velocities of the birds change rapidly. In contrast, smaller changes occur during the almost two-dimensional steady flight [10]. Our goal is to animate these different behaviors, so that the generated animations resemble flocks in nature.

Since no model exists that accurately predicts the behavior of a flock, we turn to a data-driven approach, that is, learning from examples. Given an example movie, the challenges are to determine the major variables that characterize a given flock, extract the parameters that are relevant for computing them, compute these variables, and utilize them in the creation of plausible flock shapes.

While data-driven methods have been used successfully in crowd simulation [17, 18, 20], they cannot be used in a straightforward manner in our case. This is because, unlike human pedestrians, who have their own individual trajectories, a bird flock has a common global goal—migrating together. Thus, while pedestrian behavior can be learned from various scenes in different movies, the trajectories of birds must maintain the sequential ordering of the original movie. Using the shapes in a single movie is unsatisfactory as well, since movies are typically very short and contain a limited number of possible flock shapes.

Hence, our solution combines the data-driven approach with an energy-savings model. The key idea is to learn from examples—but to learn the energy-savings (power reduction) values, not the trajectories, since these variables are generally believed to be the primary reason for flying in a line formation. A bird flying alone at steady speed demands more flight power than a bird flying in a flock, where drag reduction helps the bird save energy. *Power reduction* is defined as the ratio between this difference in flight power (that of a single bird minus that of a bird in a flock) and the flight power of a single bird.

We aim at generating shapes that preserve similar power-reduction values to those obtained in the example shapes, thus guaranteeing plausible shapes. Another benefit of this scheme is that it does not constrain us to the existing example shapes, with respect to the number of birds in the flock, the relative location of the leader bird, and the variations in birds' positions.

Alternative simpler methods, such as interpolation, not only limit the number of possible shapes (e.g., the shapes in Figure 4, discussed in Section 5, are not interpolations of the given shapes), but might also generate shapes that are not consistent with feasible energy-savings values, and thus could not occur in nature.

Below we describe the three components of our method: parameter extraction, steady flight, and flock initiation. We elaborate in Sections 45–6.

**Parameter extraction:**Most existing movies of line-formation flocks show small portions of the flight in a formation (steady flight). We aim at extracting the parameters that can help us compute the power-reduction values of the birds, which are essential in creating plausible flock shapes. These parameters are the flock's optimal shapes and outliers.**Steady flight:**In nature, the shape of a flock changes constantly, and an optimal shape, as predicted by known models of energy savings, is seldom obtained. Therefore, our approach incorporates energy-savings values with a data-driven approach.**Initiation:**The goal is to produce an animation that begins with a given (e.g., random) distribution of the birds and ends when the flock converges to the first shape in the steady-flight animation (Figure 2). As in previous*artificial bird*models, our animated bird lives in a*world*and*perceives*its state through its senses. The bird's*actions*are governed by its interpreted perception and attempt to satisfy its*drives*. We propose a new set of drives, suitable for flocks flying in line formations: target-reaching (the tendency of a bird to reach a specific distance from a chosen reference bird) and separation (the tendency of a bird to have a unique reference bird to follow). Figure 3 shows some examples of how these rules, when combined, model the convergence of the flock to some shapes.

## 4 Parameter Extraction

We are given a movie of a real -bird flock flying in a formation (steady flight). Our goal is to extract the parameters that would let us compute the power-reduction values that would be later used to produce the animation. The algorithm consists of two steps. First, the position parameters are extracted for each movie frame. Then, the optimal geometric shape of the flock and the outliers are computed for each frame.

### 4.1 Step 1—Position Parameter Extraction

The birds are first sorted by their horizontal (*x*) positions in the first frame and indexed accordingly. Then, the following parameters are extracted for each frame *f*:

- 1.
Ordering: The order of the birds according to their

*x*positions. - 2.
*x*distance statistics: The mean μ_{xf}and the standard deviation σ_{xf}, of the horizontal distances between neighboring birds. - 3.
Leader bird: The index of the leading (foremost) bird.

### 4.2 Step 2—Computing the Optimal Shape and the Outliers

To compute the optimal geometric shape that matches the flock's shape in a given frame and its outliers, we use the RANSAC (random sample consensus) algorithm [6]. RANSAC allows a model to be fitted to a data set that contains outliers, and these outliers to be detected. It achieves its goal by iteratively selecting a random subset of the original data. This subset, composed of hypothesized inliers, is then tested. This procedure is repeated, each time producing either a model that is rejected because too few points are classified as inliers, or a refined model together with a corresponding error measure.

In our case, the input to RANSAC is the positions and the possible models. These models are either a parabola for {U, J} shapes or a linear function for {V, line} shapes. The output is the model's parameters and the model's outliers. At the end of this stage, we produce the following information:

- 1.
The optimal geometric shape that best fits the current formation, as well as the outliers.

- 2.
Position deviations: The inliers' mean

*y*position μ_{yf}, and their standard deviation σ_{yf}. - 3.
Special roles: Being either a leader or an outlier bird is considered a special role.

## 5 Steady Flight

In nature, the steady-flight stage is very long and is characterized by similar velocities of the birds and frequent small changes in their relative positions. Our proposed solution combines an energy-savings model with a data-driven approach. As illustrated in Figure 4, it does not constrain us to the existing example shapes, with respect to the number of birds, the relative location of the leader bird, and the variations in birds' positions.

The input consists of the parameters extracted (Section 4); the physical characteristic of the bird, viz., the wingspan *b*; the required number of birds in the animation, *N*; and the required number of frames in the animation, *F*. The goal is to construct an animation of a steady flight of a flock.

The key idea is to learn the flock's energy-savings patterns and generate shapes that respect them, thus creating plausible shapes. An important and novel aspect of our scheme is showing how the positions of the birds can be computed by solving a system of nonlinear equations that take the power reduction values into account.

The algorithm, which is outlined in Algorithm 1, proceeds in four steps. We first create some initial shapes whose geometry is similar to the shapes in the example movie, but whose number of birds is *N*. These shapes are used to extract the range of power reduction values for each bird. These values allow us to generate a wider variety of plausible shapes that comply with the energy-savings pattern. Once these plausible shapes are produced, they are interpolated to generate the final animation.

**Algorithm 1:** Steady-flight animation.

**Input:**

Parameters extracted in the previous sections (shapes, deviations, special roles);

*b*= wingspan;*N*= number of birds in the animation;*F*= number of frames in the animation.

**Output:** An animation (*F* frames) of an *N*-bird flock, which consists of *F* × *N* position vectors.

**Algorithm:**

- 1.
Construct initial shapes of an

*N*-bird flock, which maintain the general shapes and deviations of the movie. - 2.
Calculate the power-reduction values of each bird, for each shape constructed in step 1.

- 3.
Construct new key shapes that satisfy the power-reduction values calculated in step 2.

- 4.
Create an

*F*-frame animation of a steady flight, by interpolating between the shapes generated in steps 1 and 3.

### 5.1 Step 1—Constructing Initial Shapes

Initially, the first frame is used to derive a correspondence between the animated birds and the movie birds. This is done by first generating a geometric curve that maintains the frame's shape parameters. The required number of birds are distributed uniformly on this geometric curve, but the leader's relative position may differ, so as to suit its relative position in the initiation. The correspondence between the birds is then performed as follows: After matching the leaders—the foremost bird of the movie and the foremost bird of the animation (irrespective of their relative location)—the sides containing more birds are matched. This is important, since each side in a line formation may have different shape parameters. Next, the birds closest to the leader and farthest from it (on each side) are matched, followed by matching the outlier birds, then the inliers, and finally adding *N* − birds if necessary (uniformly distributed).

Then, for every movie frame an animation frame is generated, as follows. The geometric curve that maintains the same parameters computed in step 2 of Section 4 is used. We need to find the exact locations of the birds on this curve. We first generate new *x* distances, by drawing a value from a Gaussian distribution, having the extracted mean μ_{xf} and standard deviation σ_{xf}. Then, the initial *y* position of each animated bird is calculated according to the curve's parameters. Next, given the correspondence between every animated bird to a movie bird, the *y* positions of birds whose corresponding example birds are outliers are modified, by adding the appropriate deviations. This is important in order for a flock to look real. Finally, we add deviations to all other birds, which are drawn from a Gaussian distribution with μ_{yf} and σ_{yf}.

### 5.2 Step 2—Power-Reduction Calculation

For each given shape produced in step 1, we compute the power-reduction value of each bird in the flock. We use the model of [13], which assumes a two-dimensional flock, with equal velocities and non-flapping wings. (More accurate models do not result in an analytic formula [16, 28].)

A flying bird creates vortices resulting in regions of *upwash* and *downwash* behind it, as illustrated in Figure 5. Other birds flying in this upwash region save energy by a drag-force reduction. Flying in a downwash region increases the drag and therefore is not beneficial. Each bird is affected by the upwash field generated by all the other birds in the flock, where the influence of laterally distant birds is small.

*C*be the drag ratio, and

*g*

_{ij}be a function defined below, which depends on the distance between birds

*i*and

*j*. When the birds in the flock have similar body parameters, the power reduction for bird

*i*is Since the drag ratio

*C*is constant for all the birds under our assumptions, we ignore it from now on.

*x*

_{ij}(

*i*≠

*j*) be the lateral distance between the centers of the bodies of birds

*i*and

*j*, and

*y*

_{ij}be their vertical distance, normalized by the wingspan

*b*. Here

*y*

_{ij}is positive if bird

*i*is behind bird

*j*, and negative otherwise. Assuming that the birds do not fly in the downwash regions,

*g*

_{ij}is given by [13] In this function the power reduction decreases nonlinearly to zero as the

*x*distances increase, and increases to a constant value as the

*y*distances increase, as illustrated in Figure 6.

### 5.3 Step 3—Constructing Feasible Key Shapes

The goal is to construct a variety of feasible key shapes, which satisfy the movie's power-reduction values, but may differ from the original movie in shape. This is performed by first associating every animated bird with a range of typical power-reduction values (obtained at step 2) and then generating new shapes that comply with this range.

In fact, we are interested in the relative power-reduction values and not the absolute ones, since the relative values characterize the flock's shape and are influenced less by the exact lateral distances between the birds.

*E*be the total power reduction of the entire flock,

*E*= ∑

_{i=1N}

*e*

_{i}. Given

*e*

_{i}(Equation 1), the relative value of bird

*i*is defined by

Let *P*_{i} be the maximal value of ξ_{i} over all the frames, and *p*_{i} be the minimal value. A feasible power-reduction range for bird *i* is defined by [(1 − ε) · *p*_{i}, (1 + ε) · *P*_{i}].

*k*, a new relative power reduction value is generated by randomly choosing a value in a range: This range accounts for both the plausible range and the preceding shape. ε,

*C*

_{1}, and

*C*

_{2}are user-defined parameters. (In our experiments, 0 ≤ ε ≤ 0.2, 0.75 ≤

*C*

_{1}≤ 0.9, and 1.1 ≤

*C*

_{2}≤ 1.25.)

Our goal is to compute the location of each bird in the flock, using the above relative power-reduction values . However, for computing these positions, we will show that we must know the absolute power reduction value for each bird, which is unavailable. (It cannot be drawn from the movie, since it is meaningless by itself; only the distribution of the values among the birds provides the shape information.)

*ê*

_{i,k}, which are defined by we take advantage of a special property of the total power reduction ∑

_{n=1N}

*ê*

_{n,k}of the flock: According to the displacement theorem of Munk, the total power reduction of flocks having the same number of birds and

*x*distances is constant [13]. The longitudinal displacements have no influence on it, but rather only on its distribution.

We thus choose arbitrary *y* positions and assume that the *x* distance is constant, chosen from the range of possible mean *x* distances. We now compute the total power-reduction value for these positions. Note that though each bird's power reduction depends on this specific *y* position (and thus cannot be used), the total sum can be utilized in our calculations.

*ê*

_{i,k}}

_{i=1N}(Equation 5) corresponding to the relative power-reduction values , the positions of the birds are calculated. They are the solution of the following system of

*N*nonlinear equations: where

*e*

_{i}(

*x*

_{1i}, …,

*x*

_{Ni},

*y*

_{1i}, …,

*y*

_{Ni}) is the function presented in Equation 1, which takes the geometric function

*g*

_{ij}into account.

The solution to this system gives us the *N* − 1 unknown relative *y* positions, and hence the exact position of each bird in the flock. The system is solved by the Levenberg-Marquardt algorithm for each key shape.

## 6 Flock Initiation

The input to this stage is the *target shape*, which is the first key shape in the steady flight. This shape consists of the positions of the *N* birds. The challenge is to generate a flock initiation that converges to it from any initial conditions.

Energy-savings models cannot be utilized for initiation, since they are applicable only to the stage of steady flight. Instead, we adopt the artificial bird model and specify new rules, whose application for each bird results in convergence of the target shape.

At each time step of the initiation animation, each bird is characterized by its flight direction, flight speed, and position. Its actions, which aim at satisfying its drives, result from the perceived world at the previous time step. Below we discuss all these components.

### 6.1 Modeling Perception

Artificial animals have senses through which they perceive limited information about the world. Since in nature most line-formation flocks take off from obstacle-free environments and fly in the open sky, we define the world as a collection of birds. We consider the visual perception and apply two operations at every time step: determination of the visible birds and detection of the reference bird (Figure 7).

To determine the visible flockmates, the visual volume is first set (in our setup, it is 90° per eye). Then, each bird is modeled by a point and the *hidden point removal* (HPR) operator [15] is applied. This operator computes visibility directly from a point set, by extracting the points that reside on the convex hull of the spherically inverted point set. This inversion reflects the points with respect to a sphere of radius *R*. The question is how to choose *R* so as to take into account the sparsity of the point set and the fact that the points have volume. Our experiments indicated that choosing *R* to be half of the bird's wingspan provides good results. Recall that the wingspan depends on the bird species. For instance, for a Canadian goose it is 1.5 m.

Next, each bird chooses a *reference bird* from its visible flockmates—a bird it aims to follow. Since following a bird should require as little effort as possible, in terms of speed and direction changes, the reference bird should be nearby. The closest bird within a visual volume of 0.35π per eye is chosen. If no such bird exists, the closest visible bird is selected. Thus, at the beginning of the animation several different birds may have the same reference bird, but this will be resolved by the separation drive as the animation proceeds. If a bird does not have any visible flockmates, it does not have a reference bird (although it may gain one in subsequent time steps). Each bird acquires the following information about its reference bird: speed, direction, relative side (left or right), and whether it is the leader (foremost) of the flock.

### 6.2 Modeling Drives and Actions

Below we describe our proposed drives—*target-reaching* and *separation*—and their realization.

#### 6.2.1 Target-Reaching Drive

The target-reaching drive accounts for the main distinction between line-formation flocks and cluster-formation flocks. Rather than attempting to fly “close” to their flockmates (by attraction) to form a cluster, the birds try to converge to a certain shape. Since no global decisions are made, this target shape should be attained through the actions of each individual bird. The drive of each bird (excluding the leader) is, hence, to reach a position at a certain *target distance* on a certain *side* (left or right) relative to its reference bird (which can change at every time step).

The resulting actions of this drive are changes in the bird's speed and direction. These actions are performed by first determining the relative side and distance from the reference bird, as follows.

##### 6.2.1.1 Side Determination

Every bird determines its relative side, so as to satisfy global consistency and avoid zigzagging, as illustrated in Figure 8. At every time step, if the reference bird has an undetermined side (e.g., at the first time step), the bird chooses its side according to its current relative position: If it is to the right of the reference bird, its side will be set to the right. Otherwise, the bird's side is set to that of its reference bird. Note that this will result in a shape in which the leader may have followers on both sides, whereas a non-leader may be followed on a single side.

##### 6.2.1.2 Target-Distance Determination

A correspondence between each animated bird and a bird of the target shape is determined. First, the leaders are matched. Then, birds whose reference birds have already been matched are also matched consistently. Note that many animated birds may initially be matched to the same bird of the target shape. This will eventually be resolved as the animation proceeds. The target distances (vectors) are derived from the corresponding distances in the target shape.

##### 6.2.1.3 Calculation of Speed and Direction

Speed changes depend on three factors: the distance to the target position, the velocity of the reference bird, and the bird's flight direction. Obviously, if the distance is large, the bird should accelerate in order to reduce the gap. Moreover, if the reference bird is moving fast, its followers must adjust their speed to catch up with it. If the flight directions of the reference bird and its follower differ considerably, increased speed may result in increased distance, as a result of a fast flight in a wrong direction. To model the bird's finite energy and avoid inconsistencies, we restrict the maximal changes to both direction and speed.

Let *i* and *j* be the indices of a specific bird and its reference bird, respectively. Let be the position of the reference bird, flying at speed *v*_{j} in direction . We wish to calculate the speed *v*′_{i} and direction of bird *i* in the next time frame (Figure 9).

First, the position of the reference bird in the next time step is predicted as . Then, the target position of bird *i* is calculated as , where is the target distance obtained before, assuming the distance has the correct sign.

*v*′

_{i}is calculated as follows. Let

*r*

_{i}be the distance from bird

*i*to its target position, , be a unit vector in the direction from to the target position , and Δ

*d*be the angle between and . Then, In this equation, the new speed

*v*′

_{i}increases as the reference bird's speed increases. Moreover, it increases with the distance

*r*

_{i}(so as to catch up). However, it decreases if the flight direction is not aimed at the target position. Finally, the sign of the parameter

*K*is set according to the relative location of the bird and its target position. (In our implementation,

*K*= ±0.06, yet it works well for other values.) If the difference between the new and the previous speeds exceeds the maximum allowed change, this maximum is used.

_{i}, is derived by: Here, the change in direction is inversely proportional to the distance

*r*

_{i}, so that when the bird is far from its reference bird, it will change its flight direction slowly, whereas if it is close, it will change its direction quickly, to avoid missing the target. It is also proportional to Δ

*d*, the total expected change in angle. The constant α is set to 0.2 in our experiments.

#### 6.2.2 Separation Drive

The separation drive has two goals. First, it ensures that at the end of the initiation, each bird (except for the leader) is followed by at most one bird. In addition, it aids in avoiding collisions between the birds.

This drive is realized as follows. Each bird detects the birds having the same reference bird among its visible flockmates. If such a bird is found and the distance between them is sufficiently small, it will choose a new reference bird. Hence, if two birds have the same reference bird, only the rear bird will change its reference bird. If the distance between the birds is large, they will continue in their flight until they come closer to each other. (The threshold used is 10 times the wingspan.)

Note that our separation drive is fundamentally different from those of [4, 24]. While the latter simulate repulsion from visible flockmates, ours simulates repulsion from the cluster of flockmates following the same reference bird. In addition, rather than resulting in changes in speed and direction, our drive results in selecting a new reference bird.

## 7 Results

The accompanying movie (see Section 1) and Figures 10,^{11}^{12}^{13}–14 show some results. Figure 10 shows an example where the number of birds in the movie and the animation is the same. The animated birds are superimposed on the real barnacle geese, so that they could be compared. While the shapes are not identical, they are similar and look as natural as that of the real flock.

Figures 11 and 12 show snapshots from an animation that uses the same example movie (of nine birds), yet creates an animation of 14 birds. Figure 12 demonstrates initiation from random locations, whereas Figure 11 shows the steady flight stage. It can be seen that the general shapes are maintained, creating realistic-looking flocks. For instance, the two rear birds on the right side are very close (in *x* coordinates) to each other. This happens in the original movie for the rear birds on the left. Moreover, it is interesting to note that the flock changes from a U shape to a V shape. This occurs both in the original nine-bird flock and in the animated 14-bird flock.

Figure 13 demonstrates snapshots from an animation of snow geese. It compares the original movie (bottom) with our animation (top). Again, our data-driven approach is capable of reconstructing similar general shapes. Figure 14 demonstrates an animation of a large flock of 41 cranes. Our animation manages to construct the V shape of the flock. In the animation, in contrast to the example, the right side of the flock is longer than the left, and therefore the bird switches position in the opposite direction. In nature, switching sides during flight is pretty rare. Our animation-by-example approach manages to animate it.

*Data acquisition* is an interesting problem in its own right, but outside the scope of the current article. In our examples, we tried to choose example movies in which the flocks were recorded (almost) from above. The camera motion and the depth of the birds were not estimated, similarly to [18]. The frames are manually chosen from the input movie, and the birds are marked. This takes about 2–5 min of manual work per movie.

## Conclusion

This article introduced an approach for animating flocks of birds flying in line-formation patterns. We distinguish between the behavior of such flocks during initiation and their behavior during the steady flight, and propose different techniques for modeling and animating each of these stages. A data-driven approach that utilizes an energy-savings model is proposed for animating the steady flight. We show that this problem can be formulated as a system of nonlinear equations and solved. Rules are used to govern the behavior of the birds during initiation. These rules differ from those of previous work, which focused on flocks flying in clusters.

Our results are evaluated in two manners. First, they are compared with those on real flocks, and it is found that they look natural for a variety of line-formation patterns. Second, we guarantee that the energy-savings values are reasonable for each bird in the flock. Since it is believed that these values are the major cause for flying in formation, this ensures that our flocks are indeed plausible.

Our method has several limitations, which should be addressed in the future. First, our initiation algorithm cannot handle inverted shapes (such as inverted U or V) that exist in nature. These shapes have two leaders, while our technique assumes a single leader. Similarly, some flocks are shaped as a large V with another line attached to the middle of one of its sides. Our techniques cannot simulate such flocks. Second, we do not specifically model environmental conditions, such as wind gusts. However, since our animation is guided by a real-world example, the influence of some environmental conditions is indirectly allowed for. Third, in the data acquisition stage we assume that the example movies are shot from above or below. Instead, the method should consider perspective transformation. Finally, more advanced techniques for animating wing flapping, such as [33], can be used.

## References

## Author notes

Contact author.

Department of Electrical Engineering, Technion, Haifa, Israel. E-mail: ayellet@ee.technion.ac.il (A.T.)