Interactive manipulation of rigid body simulations

Physical simulation of dynamic objects has become commonplace in computer graphics because it produces highly realistic animations. In this paradigm the animator provides few physical parameters such as the objects' initial positions and velocities, and the simulator automatically generates realistic motions. The resulting motion, however, is difficult to control because even a small adjustment of the input parameters can drastically affect the subsequent motion. Furthermore, the animator often wishes to change the end-result of the motion instead of the initial physical parameters. We describe a novel interactive technique for intuitive manipulation of rigid multi-body simulations. Using our system, the animator can select bodies at any time and simply drag them to desired locations. In response, the system computes the required physical parameters and simulates the resulting motion. Surface characteristics such as normals and elasticity coefficients can also be automatically adjusted to provide a greater range of feasible motions, if the animator so desires. Because the entire simulation editing process runs at interactive speeds, the animator can rapidly design complex physical animations that would be difficult to achieve with existing rigid body simulators.


Introduction
Physical simulation programs provide powerful tools for creating realistic motion in animated shorts and feature films. These methods enable quick and easy generation of complex physical behaviors such as a ball bouncing, window breaking [22], cloth folding [2], and water flowing [10,24]. An attractive feature of physical simulation is that the animation is generated automatically-the an- * Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, PA 15213-3891. http://www.cs.cmu.edu/˜jovan Figure 1: The animator manipulates the simulation by first fixing the hat's landing position on the coatrack with a "nail" constraint. While the animator rotates the hat at an earlier time to achieve the desired spin, the constraint maintains the desired landing location.
imator only needs to specify a few physical parameters such as initial positions and velocities.
Despite the appeal of simulation techniques, their primary drawback is lack of intuitive control over the resulting motion. The animator often wishes to adjust the motion to achieve a desired effect such as a new end-position or a more pleasing look. However, directly altering the underlying physical parameters to try to achieve the desired effect is often cumbersome and nonintuitive. In many cases, the animator would prefer to edit the animation itself, by direct manipulation of positions and velocities.
We introduce a novel interactive technique for manipulating rigid body simulations. Throughout the interaction, our system displays the entire trajectory of all objects in the scene. The animator is free to manipulate the entire motion by grabbing and changing the state of the object (position, velocity, etc.) at any location on its trajectory. For example, suppose the animator wants to design a scene in which an actor successfully tosses his hat onto a nearby coatrack, but instead has an animation of the hat falling to the floor. In our paradigm, the animator first selects the hat at its landing position and simply drags it onto the coatrack. There are many ways in which the hat can land on the coatrack and the current motion may not have the desired style. The animator can adjust the style by first fixing the landing position on the coatrack to ensure the desired landing location and then rotating the hat at an earlier time until the hat motion achieves the desired spin ( Figure 1).
This hat example illustrates the use of position constraints to control rigid body animations. More generally, our system provides the ability to set arbitrary position, orientation, and velocity constraints on multiple objects at multiple points in time. Furthermore, we also provide floating time constraints that may be satisfied at any point in time. For example, an animator can adjust where a mug hits the ground on its third bounce, without fixing the time when that bounce occurs.
A key problem in controlling dynamic simulations is obtaining sufficient degrees of freedom to avoid over-constrained problems.
In our system the animator may add degrees of freedom by varying physical parameters that specify the internal properties of the environment, including shapes, masses, surface normals, elasticity coefficients, and moments of inertia. Often the best choice for these parameters is not at all obvious to the animator but yet can have a very dramatic effect on the resulting animation. Our system automatically adjusts these physical parameters according to the animator's desired effect. We have found this capability to be useful even in under-constrained problems. In particular, motion in chaotic systems is highly sensitive to small perturbations in the initial conditions. Adding control variables near desired manipulation times (i.e. variation of surface normals at the previous collision) improves the conditioning without affecting the perceived realism of the animation [4]. Furthermore, the additional parameters increase the range of feasible motions, enhancing the animator's ability to create interesting effects.
Interaction is an integral component of our approach. The animator is able to directly control the motion without manipulating the underlying physical parameters, and immediately sees the results of her adjustments. As a result, she can quickly explore the space of possible motions to achieve the desired behavior. Unlike previous motion-construction tools [29,8,21,19,23], our system does not evaluate the quality of motion with an objective criterion such as time-optimal motion. Instead, the animator imparts her aesthetic or other subjective criteria and interactively guides the system towards the desired motion. Internally, our system represents the entire motion of bodies by the physical parameters that control the simulation (i.e., initial positions and velocities, surface normal variations and other parameters included by the animator). As the animator interactively manipulates the motion, the system computes the new physical parameters that achieve the desired motion update. This is achieved in real time using a fast differential update procedure in concert with a rigid body simulator. Motion discontinuities pose an additional challenge (e.g. when a point of collision changes to a different facet on a body's polyhedral mesh) because the motion changes abruptly. When this happens, our system performs a local discrete search in physical parameter space to compute the motion that most closely complies with the desired adjustments.
The remainder of the paper is divided into six sections. In Section 2, we discuss related work. We outline the basic algorithm in Section 3, and discuss further details in Section 4 and Section 5. In Section 6, we outline the specifics of our prototype implementation and report on the experimental results, and in Section 7, we conclude and describe directions for future work.

Related Work
Dynamics and motion of mechanical systems are important to many fields. Optimal control theory provides the groundwork for maximizing the performance of evolving dynamic systems [25]. In robot path planning, kinodynamic planning refers to the problem of computing robot paths that satisfy both dynamic and kinematic constraints [9]. In computer graphics, the spacetime constraints technique for animation of characters computes optimal motion subject to constraints [29,8,21,19,23]. Other techniques [3,6,16] also rely on gradient information to compute the motion that satisfies certain constraints. All of the above techniques solve for the actuating forces which produce a motion. Because of this, they do not directly apply to our problem of controlling the rigid body simulations because we wish to control passive objects (i.e. objects without any self-propelling forces).
Several researchers have addressed the inverse problem of constructing a dynamic rigid body motion given the desired body configurations. Tang et al. [27] formulated this inverse problem as an optimization task and extended the genetic algorithm technique to compute solutions for a class of 2-D N-body problems. For a 2-D billiards simulation, Barzel and colleagues [4] computed successful shots using a backward search from the desired final locations of billiard balls. Chenney et al. [7] applied the Markov Chain Monte Carlo (MCMC) method to construct 3-D motions that achieve de-sired body configurations. The MCMC technique excels at constructing motions for systems with chaotic behavior such as the motion of pins after collision with a bowling ball. The main drawback of these approaches is lack of interactivity: these systems may require several hours to construct a solution. If the animator does not like the resulting motion, she must adjust the desired body configurations and start again. We argue that interactivity is essential when aesthetics is a primary concern.
Our interactive technique is related to the method for geometric modeling described by Witkin et al. [28]. Similar techniques have also been devised for drawing applications [13], interactive camera control [14] and others. In its treatment of motion discontinuities, our approach most closely resembles that of Harada et al. [17], which combines continuous and discrete optimization for applications in architectural design. In this approach, when the imposed architectural constraints can no longer be enforced with the continuous parameters, the solver performs a local discrete search to find a new room arrangement in which the constraints are satisfied.

Interactive Manipulation
Our algorithm computes the required physical parameters so that the resulting motion satisfies desired constraints. In this section, we define some basic concepts and give a top-level description of our algorithm.

Simulation Function
Following the Lagrangian approach, we describe mechanical systems in terms of their generalized coordinates and velocities [26]. A system of one or more rigid bodies is described by a generalized state vector q whose components are the generalized coordinates and velocities of the bodies in the system. The behavior of a system is described by a set of ordinary second order differential equations [26], which we write in vector form as a coupled first order differential equation, where F(t, q(t)) is derived from the Newton's law (e.g. see Equation 8). As mentioned in Section 1, our technique varies several physical parameters-in addition to the initial position and velocity q 0 -to modify the simulation. We encode all of these parameters in the control vector u, and extend the differential equation appropriately: This equation of motion completely describes the system in free flight (i.e. when there are no collisions): integrating Equation 2 yields Collisions can be handled in a number of ways, but for computer animations the simple Poisson collision model suffices [20]. This model can represent elastic and inelastic impacts by applying instantaneous impulses to the colliding bodies. The system simulates the motion during free flight by numerically solving Equation 2. At collision times additional impulses are applied to the system. Because the control vector u includes physical parameters such as surface normals at collisions and elasticity coefficients, the impulse I(q − , u) directly depends on the control vector u. At collisions the simulator maps the generalized state an instant before the collision q − into the state an instant after the collision q + (e.g. see Equation 10): More abstractly, given the control vector u the rigid body simulator computes the simulation function S, which specifies the state of the bodies in the world at every point in time: In principle, the animator could manipulate the motion q(t) by adjusting the control vector u. However, such a form of control would be tedious because the relation between u and q(t) is complex and nonintuitive. Instead, we would like to allow the animator to specify the state of bodies q(t i ) at specific times t i = t 0 , . . . , t n , and let the algorithm compute the control vector u that produces the desired motion. This is a difficult problem [27,7] for three reasons. First, the domain of the simulation function S is high-dimensional: for a single 3-D body, the components of the generalized state q are the body's position, orientation, linear, and angular velocity . Second the simulation function is highly nonlinear. A consequence of the integral nature of the simulation function is that small changes in the initial conditions can result in drastic modifications of the motion. Third, the simulation function is not continuous. Each collision event (e.g., different vertices of an object colliding with the ground) bifurcates the simulation function. We adopt a differential approach for manipulating the simulation function. The animator adjusts the motion by specifying a differential change of motion δq i in the generalized state q(t i ) at time t i . The system responds by reshaping the current motion to comply with the adjustments. Continuing the interactive manipulation, the animator gradually guides the system toward the desired solution. To compute a new control vector that reshapes the motion in compliance with the differential changes δq i , we locally linearize Equation 5, We combine all animator-specified constraints into a linear system which we solve for δu by conjugate gradient technique. The differential vector δu describes the direction in which to change the current control vector u to obtain the desired motion change δq i . The differential update is simply a small step in the computed direction, Given the new, updated control vector u , a rigid body simulator computes the new motion and displays the result. At this point the entire process repeats.

2-D Particle Example
To help provide an intuition for the issues underlying our approach, we begin with an illustrative example. Suppose that a single 2-D particle moves under the action of gravity. The generalized state q ∈ R 4 encodes the particle's position x ∈ R 2 and velocity v ∈ R 2 . If g is the acceleration of gravity, the equations of motion, d dt Figure 2: The simulation function for the motion of a particle bounce.
describe the particle's path in free flight. The solution to this differential equation yields the simulation function: If the particle collides with an immovable obstacle, the Poisson collision model applies an impulse to change the particle's velocity. For frictionless collisions, the impulse acts in the direction of the surface normal n at the point of collision. The equation, applies an impulse to instantaneously change the particle's velocity before the collision v − into its velocity after the collision v + . Given these analytical expressions for the particle's motion, we can plot the space of all possible trajectories for the particle as a function of the initial conditions and the environment. For concreteness, suppose the particle collides with a single parabolic obstacle. For notational convenience, we introduce a unit circle around the obstacle: the particle enters the circle at some angle θ 0 with unit velocity vector directed towards a point at height h above the tip, bounces off the obstacle, and exits the circle at another angle θ f ( Figure 2). Our objective is to determine θ f as a function of θ 0 and h.
In this example, the simulation function S : R 2 → R maps the control vector u = (θ 0 , h) into the particle's final, exit position θ f . Given an initial entering θ 0 and exiting θ f state, our gradient-based interactive technique can smoothly transform this solution to one which satisfies one or more constraints, for example to achieve a different exiting state θ f . Our technique converges easily because the simulation function is smooth over the domain of control parameters ( Figure 2).
The general motion of many rigid bodies is much like this simple particle example. To describe the state of a single 3-D rigid body, we increase the dimensions of the generalized state, adding the components of orientation, angular velocity, and extending the position and linear velocity to 3-D. Two or more rigid bodies are modeled by adding additional components to the generalized state. Surface parameters such as normals and elasticity coefficients may also be added, if desired. Note that the number of rigid objects is not explicitly represented, we are merely expressing the cumulative degrees of freedom of the system. Our implementation makes use of this representation to enable complex multi-object simulations with the same computation techniques and data structures used to implement particle simulations.

Manipulation without Discontinuities
The algorithm outlined in Section 3 relies on the efficient computation of the Jacobian matrix ∂S(t i , u)/∂u. Computing the Jacobian matrix with finite differences is expensive because of the need to perform multiple simulations. In addition, the inaccuracies of the finite differences approach would be prohibitive for our approach.
Instead we use a specialized automatic differentiation technique. We decompose the simulation function S into analytically differentiable functions and numerically compose the Jacobian matrix using the chain rule. For example, suppose that a single collision occurs at time t c and the simulation function S(t f , u) describes the body's state at some time after the collision t f > t c . We decompose S(t f , u) into three functions: The functional composition expressing S(t f , u) becomes: 1 Although the free-flight motion of the particle in Section 3.2 has a closed-form and is analytically differentiable, this is generally not the case for 3-D rigid body motion. 2 To compute the derivatives of ∂F t c (u)/∂u, we first integrate the equations of motion (Equation 1) until time t c , and take the derivative of both sides with respect to u To evaluate this expression we apply the Leibnitz rule [18] to interchange the integral and the derivative: 3 The simulator computes the value of F(t c (u), q, u) at the collision.
To compute the collision time derivative dt c (u)/du we define a smooth collision event function E(t, q) such that at the collision time t c (u), For the 2-D particle, for example, the collision event function E can be defined as the signed distance function between the particle and the obstacle.
Differentiating Equation 13 and solving for the collision time derivative we obtain The derivatives on the right-hand side of Equation 14 are computed analytically, with the exception of ∂q/∂u, which is defined by the integral expression (second and third term in the sum) in Equation 12. We compute this integral expression by numerically integrating differential equation until time t c with the initial condition ∂q 0 (u)/∂u. The computation of ∂F t f (u)/∂u is similar: we apply the Leibnitz rule to obtain ∂F(t, q, u) ∂u dt and evaluate the right-hand terms as before.
To compute the derivatives of ∂C t c (u)/∂u we differentiate the Equation 4: Once all derivatives of the sub-functions have been computed we find the simulation function derivatives by applying the chain rule: Although we have shown the derivative computations for the composition of three phases, an arbitrary number of such phases can be composed in an analogous manner.

Differential Update
Having computed the Jacobians, we can formulate the constraint equations (Equation 6). Given n such equations, we solve for the differential vector δu. Because this system is often underconstrained (Section 1), we solve the following minimization instead: The minimized objective function has a dual purpose: it seeks the smallest change from the current state of the simulation and the smallest deviation from the desired values of the simulation parameters such as surface normals at the collision. The diagonal matrix M describes the relative scale between parameters in the control vector u. The animator can describe the desired scaling to specify how the system should change the parameters. For example, the animator may instruct the system to favor changing the initial position rather than the initial velocity of a body. The vector d defines desired values for physical parameters. For example, if the system varies the surface normal at a collision we can specify the true geometric normal as the desired value and the system will attempt to stay as close as possible-once all constraints are satisfied-to the true surface normal. Specifically, if δu d is the desired change in the control vector u then setting d = −δu d and optimizing Equation 15 will minimize (δu − δu d ) T (δu − δu d ). Because the objective is quadratic and all constraints are linear, we use the Lagrangian multipliers to reformulate the minimization as a linear system and solve for δu [12]. Our technique is a form of gradient descent: we continuously linearize the problem and move in the gradient direction δu. For a large gradient stepsize , the gradient descent method may diverge. Line minimization is the preferred method for choosing the stepsize in a gradient method, but it requires considerable computation. In practice, a small fixed stepsize has good convergence properties while also enabling interactive update rates.
The gradient descent converges only to a local optimum [5]. Local convergence is sufficient and effective for our interactive setting: the animator drags a body towards the intended positionguiding the system out of undesirable local minima-and the system quickly reshapes the motion to comply with the change.

Manipulation Constraints
When the animator specifies the constraints, the system maps these constraints to the appropriate differential changes of motion δq i . We distinguish three types of constraints: state constraints, expression constraints, and floating constraints.
State constraints occur when the animator "nails down" objects (e.g., fixing position, orientation, linear velocity or angular velocity to specific values). Suppose that the animator wants the body A at time t i to have the state q A , and that q A is a subset of the generalized state of the whole system q which describes the state of the body A. We write the desired differential change as q A − q A (t i ). In this case the nail constraint is enforced at a specific time instant t i .
Expression constraints are generalizations of the state constraints. Any differentiable expression of the generalized state q can represent a constraint. For example, the animator can equate the speed of two bodies with the constraint |v(q A (t i ))| − |v(q B (t i ))|.
Both state and expression constraints can be specified without fixing the time of evaluation t i . The animator can express a constraint at a particular event-say, the fifth collision in the simulation. Time of collision t c (u) is not fixed and thus the time of the constraint can "float." For example, we can reduce the angular velocity ω of body A with the constraint −ω(q A (t i )) · ω(q A (t i )). Subsequent modification of various simulation parameters will change the time at which the collision occurs, but the floating constraint will still be enforced.

Manipulation with Discontinuities
When the simulation function is continuous, the interactive manipulation technique described in Section 4 effectively converges to the desired motion. In general, however, the simulation function contains discontinuities that may cause this technique to diverge. In this section we describe a method for improving the convergence for piecewise continuous simulation functions.
The simulation function is discontinuous whenever polygonal (piecewise linear) meshes are involved in collisions. For example, suppose we modify the particle example from Section 4 and replace the smooth, curved obstacle with a piecewise linear polygonal curve ( Figure 3). As long as the particle collides with the same edge, the simulation function remains continuous. On the other hand, when the particle collides with a different edge, the surface normal on the is discontinuous. This abrupt change carries over to the subsequent particle motion and corresponds to a discontinuity in the simulation function. We cannot disregard piecewise linear approximations because the interactive rigid body simulators often approximate smooth geometric models with polygonal (piecewise linear) meshes-mostly because meshes facilitate faster and easier collision detection.
In general, the simulation function is piecewise continuous. A connected set of control vectors for which the simulation function is continuous defines a connected component in the control space. We call these connected components smooth components because on a smooth component the simulation function is continuously differentiable. For example, a set of control vectors for which the particle collides with the same edge of the obstacle defines a smooth component (Figure 3). In this example, the four smooth components correspond to motions of the particle colliding with each of the four edges. The figure emphasizes two main problems caused by discontinuities: the loss of physical feasibility and degradation of convergence. We describe these problems and our solutions in the remainder of this section.

Physical Feasibility
As shown in Figure 3, the polygonal approximation of the obstacle restricts the physically feasible exit points for the particle. Note that some values of θ f are unattainable because the surface normal near the origin is discontinuous: the particle cannot exit at the section of the circle directly above the origin (θ f near π/2). This restriction of feasible results becomes especially evident when the animator over-constrains the system with many desired body configurations. Finer polygonal approximations reduce the gaps in the piecewise smooth function, but overly fine approximations increase the collision detection time and reduce interactivity.
Our approach to this problem is twofold. First, we introduce additional control parameters to vary the surface normals on a polygonal mesh and to simulate a collision with a smooth obstacle. If the mesh approximates a smooth surface the desired normal can be computed from a smooth local interpolant or, if available, from the true smooth surface. The normal can then be adjusted dynamically by including the normal deviation within the control vector u. As Figure 4 illustrates varying surface normals extends the range of smooth components to increase the physically feasible regions.
Second, we use curvature-dependent polygonal approximations in our simulations because they keep the facet count low for fast collision detection and simulation, but also provide good first-order approximations to the original surface [11]. For discontinuities due to polygonal approximations of smooth surfaces, the computed differential change δu continues to contain valuable information. Approximating smooth surfaces with polygonal meshes is well studied in computer graphics. In general, good approximations allocate many facets to areas of high surface curvature and fewer facets to near-planar surface regions. For these polygonal meshes, despite the discontinuity in the surface normals, the currently collid- ing facet is also a good first-order approximation to the underlying surface. In this case the differential change δu continues to be a good predictor for the differential update because the first-order approximation is sufficiently accurate for linear Equation 6.

Convergence
The interactive technique of Section 4 converges to the desired motion if there exists a path from the initial to the desired control vector within a single smooth component. With discontinuities, such a path may not exist. The discrete search must guide the control vector between the appropriate components, piecing together a path that crosses discontinuities. Especially in higher dimensions, this is a daunting task for an interactive system. In general, the search must take into account physically feasible regions and jump to smooth components in possibly distant regions of a high-dimensional control space. The most important criterion for selecting smooth components is that they facilitate convergence to the desired motion. In addition, unless instructed otherwise, the components should preserve the "style" of the current motion, as that may be of primary importance. For example, if an animator desires a successful "off-the-backboard" basketball shot, it is undesirable to jump to a smooth component corresponding to a direct, "nothing-but-net" motion. Lastly, the discrete search must complete quickly to maintain interactivity. Our solution relies on two concepts: sampling and interaction.

Sampling
In the presence of discontinuities our technique becomes more sensitive to the stepsize and the direction δu in the differential update (Equation 7). With a large stepsize , the gradient-descent method may diverge. The approximation errors in δu also adversely affect convergence. To improve convergence, we use sampling to find the best values for these parameters. To find a good stepsize we use a form of the successive stepsize reduction technique: 4 our discrete search chooses an initial stepsize and reduces it a few times to select the motion that most closely matches the desired result. Convergence results for gradient methods with non-random errors, such as approximation errors in δu, exist [5], but there are no standard techniques for improving the convergence. Recall from Section 5.1 that for discontinuities due to polygonal approximations, the update vector δu is a good heuristic for the new samples. Thus, when the simulation is directed off the edge of the smooth component, our system samples the control space from the normal distribution centered around the suggested update δu. Each such sample may produce a point on a new smooth component. We evaluate how well the corresponding motions comply with the constraints and jump to the most promising component. The animator perceives the jump as a minor "pop" in the resulting motion and typically, following the jump, the continuous manipulation continues. The sampling procedure also causes a momentary lag. While the lag could be reduced with a faster implementation, the visual pop is unavoidable in situations where the underlying motion is discontinuous. If sampling does not produce any reasonable smooth component, the system remains within the current smooth component. The animator is thus blocked from adjusting the motion in a particular way, but can continue to guide the system in a different way.
Interaction Of course, to guarantee convergence we would have to search through the entire control space. Our system does not address this more general problem-the high dimension of the control space makes the search especially difficult. Instead, our technique relies on the animator to guide the system to a motion that satisfies given constraints. For example, a body that initially flies over a wall may have to bounce off the wall and fly in the opposite direction to accomplish the desired constraint. Our technique will not make these transformations automatically. For a large class of motion design tasks, this behavior is desirable and sufficient. The interaction allows the animator to quickly experiment and guide the system toward the desired collision sequence. For example, to transform the motion of a basketball during a successful free throw, the animator may want to bounce the ball off the backboard before it goes through the hoop. In this case, the animator first guides the ball into a backboard collision, and then guides it through the hoop. We emphasize that the single constraint specifying a successful shot does not uniquely determine the desired collision configurations: the ball may bounce off the backboard, off the floor or even off the scoreboard. An automatic system would have to choose the desired motion (or keep track of a possibly exponential number of motions) according to some objective criteria. Instead, our system provides the animator with interactive, direct control over the motion and allows her to guide the system to the appropriate solution.

Implementation and Results
Implementation The implementation of our system is decomposed into three parts: (1) a differential control module, (2) a rigid body dynamics simulator, and (3) a user interface for motion display and editing. The control of the system is animator-driven. In response to an edit (a mouse event), the control module recomputes the control parameters u needed to accomplish the desired motion adjustments. These parameters are then provided to the physical simulator, which recomputes the motion and updates the display.
We use the general-purpose rigid body simulator developed by Baraff [1]. Alternatively, specialized simulators could be used that provide tighter integration with the differential control module. Our manipulation tool controls the simulator at two points: (1) it provides the control vector u for the simulation and (2) it modifies the impulses at collisions using the modified surface normals and elasticity coefficients. The simulator, in turn, computes the new motion and returns the new collision events. The computed motion is used to update the display and the collisions are used to define a new expression for the equations of motion (Equation 11).
For example, a single-bounce motion has a decomposition corresponding to Equation 11. A change in the control parameters may cause another bounce to occur. In this case, the simulator detects the additional collision. In response, our system automatically updates the equations of motion by adding an additional collision function and two more flight phases to expression in Equation 11.
We use the exponential map parameterization of orientations [15] in the control vector u, finding that it yields better results than the normalized quaternions.
Examples This section demonstrates the use of our system to construct several physically based animations. All of these exam-ples were created by direct manipulation in real-time, and each required between two and ten minutes of editing to achieve the desired animation. For each of these examples, Figure 5 shows the animations before interaction, at an intermediate point, and after the desired motion is obtained. Each image in the figure displays the entire simulation by tracing out the trajectories of one or two points on the moving objects (shown in black). After experimenting with a variety of different interfaces, we have found that this display minimizes clutter yet provides the animator with a sense of the cumulative motion that is sufficient for most interaction tasks. Of course the animator can choose to view the complete motion as a traditional frame sequence at any time during the interaction.
The objective of the first example is to have two eggs collide in the air and land successfully into two buckets on the ground (Figure 5(a)). Creating such a motion by simply adjusting initial positions and velocities of the objects would be extremely difficult due to the complexity of the motion and the constraint that the buckets themselves cannot be moved. In contrast, the desired animation is easily created from scratch using our interactive manipulation technique. First, the starting positions of the eggs are fixed, and the velocities and orientations are assigned arbitrarily. By clicking at a point on its flight path, the animator then interactively drags the first egg's trajectory towards the second egg so that the two objects collide in the air. Running at roughly 20 frames per second, the system computes the required changes in the initial orientation and velocity of both eggs to achieve the desired motion updates. Once one egg is in the bucket, the animator applies a nail constraint to fix its ending state and then drags the second egg into the other bucket.
In the second example, the animator's goal is to drop a plank onto two supports to form a table. The problem is made more difficult by requiring the plank to collide with a pyramid object in the air, prior to landing centered on the supports. This example requires the system to solve for the initial plank position, orientation, and velocity (both linear and angular) in order to achieve the desired configuration after the collision. Like the previous example, this is achieved by allowing the animator to directly manipulate the plank's desired position and orientation while the system interactively computes the corresponding physical parameters. This manipulation occurs in two steps: first the animator selects the plank after it collides with the pyramid, and positions it above the supports. Second, the plank's orientation is interactively aligned so that it lands squarely on the supports ( Figure 5(b)).
The third example demonstrates the use of normal and elasticity parameters to aid editing operations, and the use of floating time constraints. Suppose the animator wishes to keep a falling mug from tipping over without changing its initial position, orientation, or velocity. This is accomplished by adding new control parameters to control the surface normal and elasticity parameters of the floor at the points where the mug hits the floor. To keep the mug from tipping over, the animator first straightens the mug so that it is upright at the fourth bounce. The system accommodates this change by modifying the floor normal at the third bounce. Note that this change in the normal will typically alter the time at which the fourth bounce occurs, requiring a floating time constraint (Section 4.2).
Due to its angular velocity, however, the mug still tips over (Figure 5(c), center). This is prevented by constraining its angular velocity to be zero after the fourth bounce, resulting in a motion where the mug does not tip over (right). The changes in surface normals are perceived as changes in the surface texture of the floor.
The final example illustrates the ability to edit the style of an animation by modifying a previously constructed motion. In this example, a scissors is thrown into the air and lands on a coatrack ( Figure 5(d)). This initial animation is constructed by starting with a motion in which the scissors falls on the floor and then interactively dragging it to the coatrack. By selecting and manipulating the scissors at different points in its trajectory, this motion is trans-formed into one in which the scissors first bounces off the ground, performs a somersault in the air, and still successfully lands on the coatrack. This example demonstrates how progressively more interesting and complex motions may be created from simpler motions using our interactive editing approach.

Conclusion
In this paper, we have described a new interactive technique for manipulating rigid multi-body simulations. Instead of changing the simulation parameters directly, we provide an intuitive interface through which the animator can manipulate the position and velocity of objects directly. Using our system, the animator can rapidly design difficult physical animations that would be difficult to achieve with existing rigid body simulators.
For some design tasks, the interactive paradigm is not the most effective. For example, the animator may be hard pressed to chart out the sequence of collisions that will lead all billiard balls into pockets. In general, this is a difficult problem that, in some cases, may not even have a solution. Other motion-construction techniques [7,27] address these problems and, in some scenarios, construct appropriate motions after extensive computation. We envision a hybrid system that integrates a motion-construction technique with our interactive manipulation tool to improve the effectiveness of the interactive paradigm.
For the Jacobian evaluation (Section 4), our technique assumes that the collision function is analytically differentiable. This is not always the case with the rigid body simulator we use in our prototype implementation. During a resting (i.e. sustained) contact or for multiple simultaneous collisions the applied impulses are solutions to a linear complementarity problem (LCP) [1]. In general, LCP problems do not have closed-form, analytically differentiable solutions. There are many alternative formulations which may facilitate analytic differentiation. Further, the interactive manipulation technique would benefit from a specialized rigid body simulator. For example, the simulator could simultaneously integrate both body states and their derivatives.
Lastly, the interactive manipulation is not possible for all rigid multi-body systems: in some scenarios simulation alone requires considerable computational time. In these cases the animators will have to resort to an off-line motion-construction technique.