animation of flocks flying in line formations -...

11
Animation of Flocks Flying in Line Formations Marina Klotsman & Ayellet Tal Technion Abstract The coordinated flight of bird flocks is a pleas- ant and attractive sight. While most previous ap- proaches have focused on animating cluster for- mations, this paper 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. We provide a biologically-motivated technique for animating bird flocks, which produces plausible and realistic- looking flock animations. 1 Introduction Researchers in computer graphics have long been intrigued by the challenge of realistically animat- ing 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 – cluster forma- tions or line formations [1]. In cluster formations, typical of small birds as well as fish and herds, the animals are organized in irregular shapes. Con- versely, in line formations the flocks are orga- nized in a characteristic pattern, such as a line, ’V’, or ’U’. These formations are typically two- dimensional and exhibit a high degree of regular- ity in spacing and alignment. They are common in flocks of large birds, such as waterfowls, cranes, and pelicans. In his ground-breaking paper, Reynolds pro- posed animating groups by simulating the behav- ior of each bird independently [2]. The results are pretty animations of cluster flocks. Others have also addressed the animation of cluster for- mations [3, 4]. This paper 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 Figure 1: Animation of a flock of barnacle geese (snapshots) large distances in more stable shapes. Previous approaches have not distinguished between these stages and applied the same rules to the whole an- imation. While this strategy suffices for clusters, it does not suit the long, steady flights of flocks fly- ing 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 [5]. While it is often believed that the central ratio- nale is to save energy [6], no model exists that can precisely predict the birds’ positions. This lack of knowledge directed us into choosing a data-driven approach, utilizing real examples of flying flocks, for animating the steady-flight stage. Since exist- ing examples are typically very short, while the flight is extremely long, we augment these exam- ples with calculations of potential energy-savings. This combination is shown to produce not only feasible, but also eye-pleasing animations of fly- ing bird flocks. Inspired by previous work, our approach for ani- mating the initiation stage is rule-based, where the behavior of each individual bird governs the mo- tion 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 the initiation and the steady flight (Sec. 3). Second, we show how

Upload: others

Post on 16-Oct-2019

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

Animation of Flocks Flying in Line Formations

Marina Klotsman & Ayellet TalTechnion

AbstractThe coordinated flight of bird flocks is a pleas-ant and attractive sight. While most previous ap-proaches have focused on animating cluster for-mations, this paper introduces a technique foranimating flocks that fly in certain patterns (so-called line formations). We distinguish betweenthe behavior of such flocks during initiation andtheir behavior during steady flight. We providea biologically-motivated technique for animatingbird flocks, which produces plausible and realistic-looking flock animations.

1 IntroductionResearchers in computer graphics have long beenintrigued by the challenge of realistically animat-ing groups of animals. One such example is thesynchronized motion of flocks of birds, which is adelightful and fascinating sight. Flying flocks canbe classified by their formation – cluster forma-tions or line formations [1]. In cluster formations,typical of small birds as well as fish and herds, theanimals are organized in irregular shapes. Con-versely, in line formations the flocks are orga-nized in a characteristic pattern, such as a line,’V’, or ’U’. These formations are typically two-dimensional and exhibit a high degree of regular-ity in spacing and alignment. They are common inflocks of large birds, such as waterfowls, cranes,and pelicans.

In his ground-breaking paper, Reynolds pro-posed animating groups by simulating the behav-ior of each bird independently [2]. The resultsare pretty animations of cluster flocks. Othershave also addressed the animation of cluster for-mations [3, 4]. This paper introduces a techniquefor realistically animating flocks of birds flying inline formations (Figure 1).

In nature, these flocks undergo two stages:flock initiation (also termed formation) and steadyflight. Initiation occurs during takeoff, with manyrapid changes in the locations of the birds withinthe flock. During steady flight the flock flies over

Figure 1: Animation of a flock of barnacle geese (snapshots)

large distances in more stable shapes. Previousapproaches have not distinguished between thesestages and applied the same rules to the whole an-imation. While this strategy suffices for clusters, itdoes not suit the long, steady flights of flocks fly-ing in line formations. We propose modeling thesestages differently.

Why flocks fly long distances (up to 20,000miles) in specific patterns is still a puzzle [5].While it is often believed that the central ratio-nale is to save energy [6], no model exists that canprecisely predict the birds’ positions. This lack ofknowledge directed us into choosing a data-drivenapproach, utilizing real examples of flying flocks,for animating the steady-flight stage. Since exist-ing examples are typically very short, while theflight is extremely long, we augment these exam-ples with calculations of potential energy-savings.This combination is shown to produce not onlyfeasible, but also eye-pleasing animations of fly-ing bird flocks.

Inspired by previous work, our approach for ani-mating the initiation stage is rule-based, where thebehavior of each individual bird governs the mo-tion of the whole flock. We introduce a new set ofrules that better suits line formations. These rulesare based on two novel drives, target-reaching, andseparation, which help us more accurately animatethe flock in initiation.

Our contribution is hence threefold. First, wepropose to distinguish between the initiation andthe steady flight (Sec. 3). Second, we show how

Page 2: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

steady flight patterns can be produced by combin-ing a data-driven approach with an energy-savingsmodel (Sec. 5). Finally, we suggest a novel setof rules for the initiation stage of line-formationflocks (Sec. 6).

2 Related WorkMost previous work on flock animation has fo-cused on flocks flying in clusters. We briefly in-troduce this work. Then we present the prevailingbiological hypotheses that attempt to explain whycertain flocks fly in line-formation patterns and acouple of papers that animate such flocks.Cluster formations: Animation of group behav-ior – of humans and animals alike – has attracted alot of attention in computer graphics[7, 2, 8, 9, 10,11, 12, 13, 14]. We focus on bird flocks.

Heppner defines a flock as a group of flyingbirds characterized by coordination in one or moreof the following flight parameters: turning, spac-ing, timing of takeoff and landing, and individ-ual flight speed and direction [1] . In his seminalwork, Reynolds proposes three rules for animat-ing flocks: collision avoidance, velocity matching,and flock centering [2]. The aggregate flock mo-tion is a result of the actions of all the birds. In [3],stochastic differential equations are developed onthe basis of four drives: homing. interaction, at-tempting to preserve a specific flight velocity, andrandomness. In [15], it is proposed to model flocksby non-linear dynamics. In [16] a technique is de-scribed for generating constrained group anima-tions. In [4], fuzzy logic is introduced to flockmodeling. This allows the model to use uncer-tain knowledge and linguistic descriptions. Theresults are estimated and shown to improve the re-sults of [2] in some parameters.

These techniques exhibit pretty animations forcluster-shaped flocks. However, line-formationflocks are difficult to generate using these meth-ods, since the rules employed tend to “cluster” thebirds together. In [4], specific, but unrealistic, ini-tial conditions may produce line formations, butthese are likely to break during the flight.Line formations: There are two main hypothe-ses explaining the tendency of birds to adopt a lineformation: enhanced communication and aerody-namic energy savings [5]. According to the firsthypothesis, these formations are the result of thevisual requirements of line-formation flight. Ac-cording to the second, a bird in a line formationcan save energy by taking advantage of the wingtipvortex produced by the neighboring birds [17].

Without taking into account wing flapping, [18]predict the optimal distances between the birds,which yield maximal energy savings. A specific

“U” shape is shown to save energy equally for allthe birds in the flock. In [19, 20, 21], more elabo-rate and accurate power-reduction calculations arepresented. [5] suggest that small flocks containingrelated birds use “V” formations, where the lead-ing birds save less energy.

Field studies, however, show a wide variation inspacing and in deviations from the above optimalpositions. Some interpret these deviations as a fail-ure of the birds to reach an optimal energy distribu-tion [22, 23], while others view it as support for thealternative hypothesis [24, 25]. In [6], empiricalevidence supports the energy-savings hypothesis:the heart rates of white pelicans are measured andsignificant energy savings shown for flocks flyingin line formations. We adopt the energy-savingsmodel, which is currently the dominant hypothe-sis.

In [26] it is proposed to add an additional ruleto [2] in order to animate line-formation flocks.This rule keeps some portion of the bird’s fieldof view unobstructed. This causes some of thebirds to arrange into fragments of linear forma-tions. Yet, such arrangements are local and theconvergence of the whole flock to a line formationis not guaranteed. In [27], three rules are intro-duced for animating the initiation stage: coalesc-ing (seeking proximity to the nearest bird), gap-seeking (seeking the nearest position with an un-obstructed view), and stationing (avoiding down-wash regions). It is demonstrated that the flockconverges to a line formation. However, the real-ism of the animation is not guaranteed, since thedirections of the birds are not taken into account(e.g., a bird is assumed to fly forward, even whenits position changes horizontally).

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

3 General ApproachIn nature, during initiation and takeoff the posi-tions and the velocities of the birds change rapidly.In contrast, smaller changes occur during the al-most two-dimensional steady flight [1]. Our goalis to animate these different behaviors, so that thegenerated animations resemble flocks in nature.

Since no model exists that accurately predictsthe behavior of a flock, we turn to a data-drivenapproach – learning from examples. Given an ex-ample movie, the challenges are to determine themajor variables that characterize a given flock, ex-tract the parameters that are relevant for computingthem, compute these variables, and utilize them in

Page 3: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

the creation of plausible flock shapes.While data-driven methods have been used suc-

cessfully in crowd simulation [28, 12, 13], theycannot be used in a straightforward manner in ourcase. This is because, unlike human pedestrianswho have their own individual trajectories, a birdflock has a common global goal – migrating to-gether. Thus, while pedestrian behavior can belearned from various scenes in different movies,the trajectories of birds must maintain the sequen-tial ordering of the original movie. Using theshapes in a single movie is unsatisfactory as well,since movies are typically very short and contain alimited number of possible flock shapes.

Hence, our solution combines the data-drivenapproach with an energy-savings model. The keyidea is to learn from examples – but to learn theenergy-savings (power reduction) values – not thetrajectories, since these variable are generally be-lieved to be the primary reason for flying in a line-formation pattern. A bird flying alone at steadyspeed demands more flight power than a bird fly-ing in a flock, where drag reduction helps the birdsave energy. Power reduction is defined as the ra-tio between this difference in flight power – that ofa single bird minus that of a bird in a flock – andthe flight power of a single bird.

We aim at generating shapes that preserve sim-ilar power-reduction values as those obtained inthe example shapes, thus guaranteeing plausibleshapes. Another benefit of this scheme is thatit does not constrain us to the existing exampleshapes, in terms of the number of birds in the flock,the relative location of the leader bird, and the vari-ations in birds’ positions.

Alternative simpler methods, such as interpola-tion, not only limit the number of possible shapes(e.g., the shapes in Figure 4 are not interpola-tions of the given shapes), but might also generateshapes that do not comply with feasible energy-savings values, and thus could not occur in nature.

Below we describe the three components of ourmethod: parameter extraction, steady flight, andflock initiation. We elaborate in Sections 4–6.Parameter extraction: Most existing movies ofline-formation flocks show small portions of theflight in a formation (steady flight). We aim at ex-tracting the parameters that can help us computethe power-reduction values of the birds, which areessential in creating plausible flock shapes. Theseparameters are the flock’s optimal shapes and out-liers.Steady flight: In nature, the shape of a flockchanges constantly, and an optimal shape, as pre-dicted by known models of energy-savings, is sel-dom obtained. Therefore, our approach incorpo-rates energy-savings values with a data-driven ap-

Figure 2: Initiation of a “V” shape. The initiation beginswith birds distributed randomly (top left) and endswhen the flock converges to the target shape (bot-tom right). The arrows represent the flight direc-tions of the birds.

(a) U shape (b) J shape

(a) V shape (b) Line shape

Figure 3: Convergence to a variety of shapes

proach.Initiation: The goal is to produce an animationthat begins with a given (e.g., random) distributionof the birds and ends when the flock converges tothe first shape in the steady-flight animation (Fig-ure 2). As in previous artificial bird models, ouranimated bird lives in a world and perceives itsstate through its senses. The bird’s actions are gov-erned by its interpreted perception and attempt tosatisfy 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 specificdistance from a chosen reference bird) and sep-aration (the tendency of a bird to have a uniquereference bird to follow). Figure 3 demonstrateshow these rules, when combined, model the con-vergence of the flock to a variety of shapes.

4 Parameter extractionWe are given a movie of a real N-bird flock flyingin a formation (steady flight). Our goal is to ex-tract the parameters that would let us compute thepower-reduction values that would be later used toproduce the animation. The algorithm consists oftwo steps. First, the position parameters are ex-tracted for each movie frame. Then, the optimalgeometric shape of the flock and the outliers arecomputed for each frame.Step 1 – Position parameter extraction: Thebirds are first sorted by their horizontal (x-)positions in the first frame and indexed accord-ingly. Then, the following parameters are ex-tracted for each frame f :

Page 4: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

1. Ordering: The order of the birds according totheir x-positions.

2. x-distance statistics: The mean µx f and thestandard deviation σx f of the horizontal dis-tances between neighboring birds.

3. Leader bird: The index of the leading (front-most) bird.

Step 2– Computing the optimal shape and theoutliers: To compute the optimal geometric shapethat matches the flock’s shape in a given frame andits outliers, we use the RANSAC (Random Sam-ple Consensus) algorithm [29]. RANSAC allowsa model to be fit to a data set that contains out-liers and these outliers to be detected. It achievesits goal by iteratively selecting a random subset ofthe original data. This subset, composed of hy-pothesized inliers, is then tested. This procedure isrepeated, each time producing either a model thatis rejected because too few points are classified asinliers, or a refined model together with a corre-sponding error measure.

In our case, the input to RANSAC is the posi-tions and the possible models. These models areeither a parabola for {U,J}-shapes and a linearfunction for {V, line}-shapes. The output is themodel’s parameters and the model’s outliers. Atthe end of this stage, we produce the following in-formation:

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

2. Position deviations: The inliers’ mean of they-positions µy f and the standard deviationσy f .

3. Special roles: Being either a leader or an out-lier bird is considered a special role.

5 Steady Flight

In nature, the steady flight stage is very long andis characterized by similar velocities of the birdsand small frequent changes in their relative posi-tions. Our proposed solution combines an energy-savings model with a data-driven approach. As il-lustrated in Figure 4, it does not constrain us to theexisting example shapes, in terms of the number ofbirds, the relative location of the leader bird, andthe variations in birds’ positions.

The input consists of the parameters extracted(Section 4), the physical characteristic of the birdin terms of the wing-span b, the required numberof birds in the animation N, and the required num-ber of frames in the animation F . The goal is toconstruct an animation of a steady flight of a flock.

The key idea is to compute the power-reductionvalues to learn the flock’s energy-savings patterns

and generate shapes that respect them, thus creat-ing plausible shapes. An important and novel as-pect of our scheme is showing how the positions ofthe birds can be computed by solving a system ofnon-linear equations that take the power reductionvalues into account.

Figure 4: Shapes produced by our algorithm, given an exam-ple movie of 16 birds. The top row shows twodifferent shapes of a flock consisting of 16 birds,whereas the bottom row shows a flock of 28 birds.Note that the shapes are similar, but the sides arereversed. These generated shapes differ from theinput movie, yet have similar energy-savings val-ues.

The algorithm proceeds in four steps. We firstcreate some initial shapes whose geometry is sim-ilar to the shapes in the example movie, but whosenumber of birds is N. These shapes are used toextract the range of power reduction values foreach bird. These values allow us to generate awider variety of plausible shapes that comply withthe energy-savings pattern. Once these plausibleshapes are produced, they are interpolated to gen-erate the final animation.

Algorithm 1 Steady flight animation

Input:Parameters extracted in the previous section;wing-span b;N – #birds in the animation;F – #frames in the animation.Output: An animation (F frames) of an N-birdflock.Algorithm:

1. Construct initial shapes of an N-bird flock,which maintain the general shapes and devia-tions of the movie.

2. Calculate the power-reduction values of eachbird, for each shape constructed in Step 1.

3. Construct new key shapes that satisfy thepower-reduction values calculated in Step 2.

4. Create an F-frame animation of a steadyflight, by interpolating between the shapesgenerated in Steps 1 and 3.

Step 1 – Constructing initial shapes: Initially,the first frame is used to derive a correspondencebetween the animated birds and the movie birds.This is done by first generating a geometric curve

Page 5: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

that maintains the frame’s shape parameters. Therequired number of birds are distributed uniformlyon this geometric curve, but the leader’s relativeposition may differ, so as to suit its relative po-sition in the initiation. The correspondence be-tween the birds is then performed as follows: Aftermatching the leaders – the front-most bird of themovie and the front-most bird of the animation (ir-respectively of their relative location) – the sidescontaining more birds are matched. This is impor-tant, since each side in a line formation may havedifferent shape parameters. Next, the birds closestto the leader and farthest from it (on each side) arematched, followed by matching the outlier birds,then the inliers, and finally adding N − N birds ifnecessary (uniformly distributed).

Then, for every movie frame an animation frameis generated, as follows. The geometric curve thatmaintains the same parameters computed in Step2 of Section 4 is used. We need to find the exactlocations of the birds on this curve. We first gen-erate new x-distances, by drawing a value from aGaussian distribution, having the extracted meanµx f and standard deviation σx f . Then, the ini-tial y-position of each animated bird is calculatedaccording to curve’s parameters. Next, given thecorrespondence between every animated bird to amovie bird, the y-positions of birds whose corre-sponding example birds are outliers are modified,by adding the appropriate deviations. This is im-portant in order for a flock to look “real.” Finally,we add deviations to all other birds, which aredrawn from a Gaussian distribution with µy f andσy f .Step 2 – Power-reduction calculation: For eachgiven shape produced in Step 1, we compute thepower reduction value of each bird in the flock.We use the model of [19], which assumes a two-dimensional flock, with equal velocities and non-flapping wings. (More accurate models do not re-sult in an analytic formula [21, 30].)

A flying bird creates vortices resulting in re-gions of upwash and downwash behind it, as il-lustrated in Figure 5. Other birds flying in thisupwash region save energy by a drag-force reduc-tion. Flying in a downwash region increases thedrag and therefore is not beneficial. Each bird isaffected by the upwash field generated by all theother birds in the flock, where the influence oflaterally-distant birds is small.

Let C be the drag ratio and gi j be a function be-low, which depends on the distance between birdsi and j. When the birds in the flock have similarbody parameters, the power reduction for bird i is

ei = CN

∑j=1

gi j. (1)

Figure 5: The downwash region created by the bird is thegray area and the upwash is the white area. Flyingin the upwash region of other birds saves energy.

Figure 6: The geometric function gi j

Since the drag ratio C is constant for all the birdsunder our assumptions, we ignore it from now on.

Let xi j (i 6= j) be the lateral distance betweenthe center of bodies of birds i and j and yi j be theirvertical distance, normalized by the wingspan b.Assuming that the birds do not fly in the downwashregions, gi j is given by [19]:

π2

2gi j = ln

x2i j

(xi j − π4 )(xi j + π

4 )+2ln

xi j − yi j +√

x2i j + yi j2

xi j + yi j +√

x2i j + yi j2

− lnxi j − π

4 − yi j +√

(xi j − π4 )2 + yi j2

xi j − π4 + yi j +

√(xi j − π

4 )2 + yi j2

− lnxi j + π

4 − yi j +√

(xi j + π4 )2 + yi j2

xi j + π4 + yi j +

√(xi j + π

4 )2 + yi j2

+1

yi j[2

√x2

i j + y2i j −

√(xi j +

π4

)2 + y2i j −

√(xi j +

π4

)2 + y2i j].

In this function the power reduction decreases non-linearly to zero as the x-distances increase and in-creases to a constant value as the y-distances in-crease, as illustrated in Figure 6.Step 3 – Constructing feasible key shapes: Thegoal is to construct a variety of feasible key shapes,which satisfy the movie’s power-reduction val-ues, but may differ from the original movie inshape. This is performed by first associating ev-ery animated bird with a range of “typical” power-reduction values (obtained at Step 2) and then gen-erating new shapes that comply with this range.

In fact, we are interested in the relative powerreduction values and not the absolute ones, sincethe relative values characterize the flock’s shapeand are influenced less by the exact lateral dis-tances between the birds. Let E be the total power

Page 6: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

reduction of the entire flock E = ∑Ni=1 ei. Given ei

(Equation 1), the relative value of bird i is definedby:

ξi =ei

E=

ei

∑Nn=1 en

=∑N

j=1 gi j

∑Nn=1 ∑N

j=1 gn j.

Let Pi be the maximal value of ξi over all theframes and pi be the minimal value. A feasiblepower reduction range for bird i is defined by [(1−ε) · pi,(1+ ε) ·Pi].

To generate key shapes for the animation, wewant to produce values that are not only withinthis range, but also guarantee smooth transitionsbetween the key shapes. Thus, to generate a keyshape k, a new relative power reduction value ξi,kis generated by randomly choosing a value in arange:

ξi,k ∈ [(1−ε)· pi,(1+ε)·Pi]∩

[C1 · ξi,k−1,C2 · ξi,k−1].(2)

This range accounts for both the plausible rangeand the preceding shape. ε , C1, and C2 are user-defined paremeters. (In our experiments, 0 ≤ ε ≤0.2, 0.75 ≤C1 ≤ 0.9, and 1.1 ≤C2 ≤ 1.25.)

Our goal is to compute the location of each birdin the flock using the above relative power reduc-tion values ξi,k. However, for computing these po-sitions, we will show that we must know the abso-lute power reduction value for each bird, which isunavailable. (It cannot be drawn from the movie,since it is meaningless by itself; only the distri-bution of the values among the birds provides theshape information.)

To overcome this problem and compute the ab-solute power reduction values ei,k, which is definedby

ei,k = ξi,k

N

∑n=1

en,k, (3)

we take advantage of a special property of the to-tal power reduction ∑N

n=1 en,k of the flock: Accord-ing to the displacement theorem of Munk, the totalpower reduction of flocks having the same num-ber of birds and x-distances is constant [19]. Thelongitudinal displacements have no influence on it,but rather only on its distribution.

We thus choose arbitrary y-positions and as-sume that the x-distance is constant, chosen fromthe range of possible mean x-distances. We nowcompute the total power reduction value for thesepositions. Note that though each bird’s power re-duction depends on this specific y-position (andthus cannot be used), the total sum can be utilizedin our calculations.

Finally, having found the absolute power reduc-tion values {ei,k}N

i=1 (Equation 3) corresponding tothe relative power reduction values {ξi,k}N

i=1, the

positions of the birds are calculated. They are thesolution of the following N non-linear equationssystem:

ei(x1i, ...,xNi,y1i, ...,yNi) = ei,k i = 1 ≤ i ≤ N,(4)

where ei(x1i, ...,xNi,y1i, ...,yNi) is the function pre-sented in Equation 1 (which takes the geometricfunction gi j into account).

The solution to this system gives us the N − 1unknown relative y-positions, and hence the exactpositions of each bird in the flock. The systemis solved by the Levenberg-Marquardt algorithmfor each key shape (25 seconds in Matlab for 40birds).

6 Flock InitiationThe input to this stage is the target shape, which isthe first key shape in the steady flight. This shapeconsists of the positions of the N birds. The chal-lenge is to generate a flock initiation that convergesto it from any initial conditions.

Energy-savings models cannot be utilized forinitiation, since they are applicable only to thestage of steady flight. Instead, we adopt the ar-tificial bird model and specify new rules, whoseapplication for each bird results in convergence ofthe 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 aimat satisfying its drives, result from the perceivedworld at the previous time step. Below we discussall these components.

6.1 Modeling perceptionArtificial animals have senses through which theyperceive limited information about the world.Since in nature most line-formation flocks takeoff from obstacle-free environments and fly in theopen sky, we define the world as a collection ofbirds. We consider the visual perception and applytwo operations at every time step: determinationof the visible birds and detection of the referencebird (Figure 7).

To determine the visible flockmates, the visualvolume is first set. (In our setup, it is 900 per eye,though it may be wider for real birds.) Then, eachbird is modeled by a point and the Hidden PointRemoval (HPR) operator [31] is applied. This op-erator computes visibility directly from a point set,by extracting the points that reside on the convexhull of the spherically-inverted point set. This in-version reflects the points with respect to a sphereof radius R. The question is how to choose R so

Page 7: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

Figure 7: The perception model of the bird in the blue circle.The shaded area is the visual volume. Only theblack birds within this volume are visible, whilethe white birds are hidden. The reference bird is ina red circle.

as to take into account the sparsity of the point setand the fact that the points have volume. Our ex-periments indicated that choosing R to be half ofthe bird’s wingspan provides good results.

Next, each bird chooses a reference bird fromits visible flockmates – a bird it aims to follow.Since following a bird should require as little ef-fort as possible, in terms of speed and directionchanges, the reference bird should be nearby. Theclosest bird within a visual volume of 0.35π pereye is chosen. Only if no such bird exists, the clos-est visible bird is selected. (Thus at the beginningof the animation several different birds may havethe same reference bird, but this will be resolvedby the separation drive as the animation proceeds.)If a bird does not have any visible flockmates, itdoes not have a reference bird (although, it maygain one in subsequent time steps). Each birdacquires the following information about its ref-erence bird: speed, direction, relative side (left/-right), and whether it is the leader (front-most) ofthe 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 distinc-tion between line-formation flocks and cluster-formation flocks. Rather than attempting to fly“close” to their flockmates (by attraction) to forma cluster, the birds try to converge to a certainshape. Since no global decisions are made, thistarget shape should be attained through the actionsof each individual bird. The drive of each bird(excluding the leader) is, hence, to reach a posi-tion at a certain target distance on a certain side(left/right) relative to its reference bird (which canchange at every time step).

The resulting actions of this drive are changesin the bird’s speed and direction. These actions

target shape inconsistent sides incorrect distances

Figure 8: Side and distance determination. The birds in themiddle preserve the correct distances from theirtargets, but fail to choose the correct relative side.The birds in the right do not preserve the target dis-tances.

are performed by first determining the relative sideand distance from the reference bird, as follows.Side determination: Every bird determines itsrelative side, so as to satisfy global consistency andavoid “zigzagging,” as illustrated in Figure 8. Atevery time step, if the reference bird has an un-determined side (e.g., the first time step), the birdchooses its side according to its current relative po-sition: if it is to the right of the reference bird, itsside will be set to the right. Otherwise, the bird’sside is set to that of its reference bird. Note thatthis will result in a shape in which the leader mayhave followers on both sides, whereas a non-leadermay be followed on a single side.Target-distance determination: A correspon-dence between each animated bird and a bird ofthe target shape is determined. First, the leadersare matched. Then, birds whose reference birdshave already been matched are also matched con-sistently. Note that many animated birds may ini-tially be matched to the same bird of the targetshape. This will be eventually resolved, as the ani-mation proceeds. The target distances (vector) ~∆Tiare derived from the corresponding distances in thetarget shape.Calculation of speed and direction: Speedchanges depend on several factors: distance to thetarget position, velocity of the reference bird, andthe bird’s flight direction. Obviously, if the dis-tance is large, the bird should accelerate in order toreduce the gap. Moreover, if the reference bird ismoving fast, its followers must adjust their speedto catch up with it. If the flight directions of thereference bird and its follower differ considerably,increased speed might result in increased distance,as a result of a fast flight in a wrong direction. Tomodel the bird’s finite energy and avoid inconsis-tencies, we restrict the maximal changes to bothdirection and speed.

Let i and j be the indices of a specific bird andits reference bird, respectively. Let ~Pj be the po-sition of the reference bird, flying at speed v j indirection ~d j (~d j = (sin(θ j),cos(θ j))). We wish tocalculate the speed v′i and direction ~d′

i of bird i inthe next time frame (Figure 9).

First, the position of the reference bird ~P′j in

Page 8: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

Figure 10: Snapshots from a steady flight of 9 barnacle geese – the brown (higher) birds are the animated ones, whereas the grayones belong to the original movie (along with the original background). Snapshots from the initiation of this flock arepresented in Figure 1, using a different background

Figure 11: Snapshots from a steady flight animation of a 14-bird flock, whose behavior was learned from the movie of the 9-birdflock in Figure 10.

Figure 9: The reference bird is in the red circle; the gray birdis its predicted position at the next time step; thered triangle is the target position, at target-distance~∆Ti from the reference bird’s predicted position.

the next time step is predicted as ~P′j = ~Pj + v j~d j.

Then, the target position of bird i is calculated as:~Ti = ~P′

j −~U ∗ ~∆T i, where ~∆T i is the target distanceobtained before and ~U is (1 1) or (−1 1), de-pending on the bird’s side.

The updated flight speed v′i is calculated as fol-lows. Let ri be the distance of bird i to its targetposition, ri = ‖~Pi −~Ti‖, ~diT be a unit vector in thedirection from ~Pi to the target position ~Ti, and ∆dbe the angle between ~di and ~diT . Then,

v′i = v j · (1−| ∆d |

π+K

√| ri − v j | ). (5)

In this equation, the new speed v′i increases as thereference bird’s speed increases. Moreover, it in-creases with the distance ri (so as to catch up).However, it decreases if the flight direction is not

aimed at the target position. Finally, the sign ofparameter K is set according to the relative loca-tion of the bird and its target position. (In ourimplementation, K = ±0.06, yet it works well forother values.) If the difference between the newand the previous speeds exceeds the maximum al-lowed change, this maximum is used.

The direction angle of the next frame, θ ′i , is de-

rived by:

θ ′i = θi +α

∆dmax(ri,1)

. (6)

Here, the change in direction is inversely propor-tional to the distance ri, i.e., when the bird is farfrom its reference bird, it will change its flight di-rection slowly, whereas if it is close, it will changeits direction quickly, to avoid missing the target.It is also proportional to ∆d, the total expectedchange in angle. α is a constant that is set to 0.2 inour experiments.6.2.2. Separation drive The separation drivehas two goals. First, it ensures that at the end ofthe initiation, each bird is followed by at most onebird, (with the exception of the leader). In ad-dition, it aids in avoiding collisions between thebirds.

This drive is realized as follows. Each birddetects the birds having the same reference birdamong its visible flockmates. If such a bird isfound and the distance between them is sufficientlysmall, it will choose a new reference bird. Hence,

Page 9: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

if two birds have the same reference bird, only therear bird will change its reference bird. If the dis-tance between the birds is large, they will continuein their flight until they come closer to each other.(The threshold used is ten times the wingspan.)

Note that our separation drive is fundamentallydifferent from that of [2, 4]. While the latter simu-lates repulsion from visible flockmates, ours sim-ulates repulsion from the “cluster” of flockmatesfollowing the same reference bird. In addition,rather than resulting in changes in speed and direc-tion, our drive results is selecting a new referencebird.

7 ResultsFigures 10–14 show some results. Figure 10 showsan example where the number of birds in the exam-ple movie and the animation is the same. The ani-mated birds are super-imposed on the real barnaclegeese, so that they could be compared. While theshapes are not identical, they bear similarity andlook as natural as that of the real flock.

Figures 11–12 show snapshots from an ani-mation that uses the same example movie (of 9birds), yet creates an animation of 14 birds. Fig-ure 12 demonstrates initiation from random loca-tions, whereas Figure 11 shows the steady flightstage. It can be seen that the general shapes aremaintained, creating realistic-looking flocks. Forinstance, the two rear birds on the right side arevery close (in x-coordinates) to each other. Thishappens in the original movie for the rear birds tothe left. Moreover, it is interesting to note that theflock changes from a U-shape to a V-shape. Thisoccurs both in the original 9-bird flock and in theanimated 14-bird flock.

Figure 13 demonstrates snapshots from an an-imation of snow geese. It compares the originalmovie (bottom) to our animation (top). Again, ourdata-driven approach is capable of reconstructingsimilar general shapes. Figure 14 demonstrates ananimation of a large flock of 41 cranes. Our an-imation manages to construct the V-shape of theflock. 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 op-posite direction. In nature, birds switching sidesduring the flight is pretty rare. Our animation-by-example approach manages to animate it.Data acquisition: Data acquisition is an interest-ing problem in its own right, but outside the scopeof the current paper. In our examples, we tried tochoose example movies in which the flocks wererecorded (almost) from above. The camera mo-tion and the depth of the birds were not estimated,similarly to [12]. The frames are manually chosen

from the input movie, and the birds are marked.This takes about 2-5 minutes of manual work permovie.Limitations: Our method has several limitations.First, the method described for the formation stagecannot handle inverted shapes (such as invertedU or V) that exist in nature. These shapes havetwo leaders, while our technique assumes a singleleader. Second, we do not specifically model envi-ronmental conditions, such as wind gusts. How-ever, since our animation is guided by a real-world example, the influence of some environmen-tal conditions is indirectly accounted for. Third,unlike our animation of the steady flight, the initi-ation is not supported by field studies. Althoughthis is the case for all the other initiation algo-rithms in graphics, it would be good to incorporatefield studies once available.

(a) Steady-flight animation (b) Real input movie

Figure 14: Snapshots from an animation of 41 cranes (left)compared to the real movie (right). Note the in-teresting phenomenon of a bird switching sides.

8 Conclusion

This paper has introduced an approach for animat-ing flocks of birds flying in line-formation pat-terns. We distinguish between the behavior of suchflocks during initiation and their behavior duringthe steady flight and propose different techniquesfor animating each of these stages. A data-drivenapproach that utilizes an energy-savings model isproposed for animating the steady flight. We showthat this problem can be formulated as a system ofnon-linear equations and solved. Rules are usedto govern the behavior of the birds during initi-ation. These rules differ from those of previous

Page 10: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

Figure 12: Snapshots from the initiation of a 14-bird flock, whose steady flight is shown in Figure 11.

Figure 13: Snapshots from a steady flight animation of a flock of 16 snow geese. These frames show both the original movie(bottom birds) and the animated birds (on top).

work, which have focused on flocks flying in clus-ters.

Our results are evaluated in two manners. First,they are compared to real flocks, which demon-strate that they look natural for a variety of line-formation patterns. Second, we guarantee that theenergy-saving values are reasonable for each birdin the flock. Since it is believed that these valuesare the major cause for flying in formation, this as-sures that our flocks are indeed plausible.

References[1] FH Heppner. Avian flight formations. Bird-

Banding, 45(2):160–169, 1974.

[2] Craig W. Reynolds. Flocks, herds and schools: Adistributed behavioral model. SIGGRAPH Com-put. Graph., 21(4):25–34, 1987.

[3] F. Heppner and U. Grenander. A stochastic nonlin-ear model for coordinated bird flocks. AmericanAssoc. for the Advancement of Science, 1990.

[4] I.L. Bajec, N. Zimic, and M. Mraz. Simulatingflocks on the wing: the fuzzy approach. Journal ofTheoretical Biology, 233(2):199–220, 2005.

[5] M. Andersson and J. Wallander. Kin selection andreciprocity in flight formation? Behavioral Ecol-ogy, 15(1):158–162, 2004.

[6] H. Weimerskirch, J. Martin, Y. Clerquin,P. Alexandre, and S. Jiraskova. Energy sav-ing in flight formation. Nature, 413(6857):697–8,2001.

[7] A. Treuille, S. Cooper, and Z. Popovic. Con-tinuum crowds. ACM Transactions on Graphics,25(3):1160–1168, 2006.

[8] X. Tu and D. Terzopoulos. Artificial fishes:physics, locomotion, perception, behavior. In SIG-GRAPH, pages 43–50, 1994.

[9] S.R. Musse and D. Thalmann. A model of humancrowd behavior: Group inter-relationship and col-lision detection analysis. In Computer Animationand Simulation, pages 39–51, 1997.

[10] C.W. Reynolds. Steering behaviors for au-tonomous characters. In Game Developers Con-ference, pages 763–782, 1999.

[11] M. Sung, M. Gleicher, and S. Chenney. Scal-able behaviors for crowd simulation. In Com-puter Graphics Forum, volume 23, pages 519–528, 2004.

[12] A. Lerner, Y. Chrysanthou, and D. Lischinski.Crowds by example. Graphics Forum, 26(3),2007.

[13] K.H. Lee, M.G. Choi, Q. Hong, and J. Lee. Groupbehavior from video: a data-driven approach tocrowd simulation. In Symp. on Comp. Animation,pages 109–118, 2007.

[14] W. Shao and D. Terzopoulos. Autonomous pedes-trians. Graphical Models, 69(5-6):246–274, 2007.

[15] A. Okubo. Dynamical aspects of animal grouping:swarms, schools, flocks, and herds. Advances inBiophysics, 22:1, 1986.

[16] M. Anderson, E. McDaniel, and S. Chenney. Con-strained animation of flocks. In ACM symposiumon Computer animation, pages 286–297, 2003.

[17] FH Heppner. Three-dimensional structure and dy-namics of bird flocks. Animal Groups in Three Di-mensions, pages 68–89, 1997.

[18] PBS Lissaman and C.A. Shollenberger. Formationflight of birds. Science, 168(3934):1003–1005,1970.

[19] D. Hummel. Aerodynamic aspects of formationflight in birds. Journal of Theoretical Biology,104(3):321–347, 1983.

[20] D. Hummel. Formation flight as an energy-savingmechanism. Israel J. Zoology, 41(3):261–278,1995.

Page 11: Animation of Flocks Flying in Line Formations - Technionwebee.technion.ac.il/~ayellet/Ps/10-KlotsmanTal-long.pdf · Animation of Flocks Flying in Line Formations Marina Klotsman &

[21] T. Sugimoto. A theoretical analysis of formationflight as a nonlinear self-organizing phenomenon.IMA J. of Applied Mathematics, 68(5):441–470,2003.

[22] JP Badgerow and FR Hainsworth. Energy savingsthrough formation flight? A reexamination of thevee formation. J. of Theoretical Biology, 93(1):41–52, 1981.

[23] F.R. Hainsworth. Induced drag savings fromground effect and formation flight in brown peli-cans. J. of Experimental Biology, 135(1):431–444,1998.

[24] C. Cutts. Energy savings in formation flight ofpink-footed geese. J. of Experimental Biology,189(1):251–261, 1994.

[25] L.L. Gould and F. Heppner. The vee formation ofCanada geese. Auk, 91:494–506, 1974.

[26] G.W. Flake. The computational beauty of nature:Computer explorations of fractals, chaos, complexsystems, and adaptation. MIT Pr., 1998.

[27] A. Nathan and V.C. Barbosa. V-like formations inflocks of artificial birds. Artificial Life, 14(2):179–188, 2008.

[28] R.A. Metoyer and J.K. Hodgins. Reactive pedes-trian path following from examples. The VisualComputer, 20(10):635–649, 2004.

[29] M.A. Fischler and R.C. Bolles. Random sampleconsensus: a paradigm for model fitting with ap-plications to image analysis and automated cartog-raphy. Comm. of the ACM, 24(6):381–395, 1981.

[30] R.M. King and A. Gopalarathnam. Ideal aerody-namics of ground effect and formation flight. Jour-nal of Aircraft, 42(5):1188, 2005.

[31] S. Katz, A. Tal, and R. Basri. Direct visibility ofpoint sets. ACM Trans. on Graph., 26(3):24:1–11,2007.