Energy Constraints on Parameterized Models
Total Page:16
File Type:pdf, Size:1020Kb
~ Computer Graphics, Volume 21, Number 4, July 1987 ] Energy Constraints On Parameterized Models Andrew Witkin~ Kurt Fleischer~ Alan Barr~t ~Schlumberger Palo Alto Research, 3340 Hillview Avenue, Palo Alto, CA 94304 :~California Institute of Technology, Pasadena, CA 91125 Abstract of constraints the properties the model is supposed to have, without the need to manually adjust parameters to give it A simple but general approach to imposing and solving those properties. geometric constraints on parameterized models is intro- In this paper we present a simple but general ap- duced, applicable to animation as well as model construc- proach to expressing and solving constraints on param- tion. Constraints are expressed as energy functions, and eterized model hierarchies. We formulate constraints as the energy gradient followed through the model's parame- "energy" functions on the model's parameter space, non- ter space. Intuitively, energy constraints behave like forces negative functions with zeroes at points satisfying the con- that pull and parametrically deform the parts of the model straints. We then sum the constraints' energy functions to into place. A wide variety of geonmtric constraints are create a single scalar function of the parameters, and move amenable to this formulation, and may be used to influ- through parameter space to minimize the energy. ence arbitrary model parameters. A catalogue of basic We refer to the constraint functions as energy func- constraints is presented, and results are shown. tions not because they always model the energy of ac- tual physical systems, but because they play a role similar Keywords -- Constraints, Modeling, Animation to that of physical energy fimctions during the constraint solving process. For example, an energy constraint attach- I. Introduction ing points on the surfaces of two objects acts much like a A widely-used approach to modeling is to combine geo- spring that pulls the objects together. However, in addi- metric primitives--such as cylinders, blocks, and bicubic tion to translating and rotating, the objects are free to vary patches--with a variety of operators--such as translations, their internal parameters, so, for example, a cylinder may rotations, booleans, and deformatlons--to form a model vary its length or radius to meet the constraint. Although hierarchy. The task of constructing a model within this no fanfiliar physical material deforms in this stylized way framework has two parts: building the hierarchy, and set- in response to applied forces, it is easy enough to imag- ting the internal parameters of the prinfitives and opera- ine an unphysic&l material that does. Since we are using tors. Experience tells us that the second task is usually the energy analogy as a mechanism for building models, by far the more diflqcult and time-consuming, particularly rather than for sinm|ating physical phenomena, this kind when complex operators such as deformations are used. As of non-physical behavior poses no problem. the complexity of the model increases, the number of pa- Our approach provides: rameters becomes large, and they tend to interact in ways • Self.assembling models, whose parts move and deform that make the model difficult to control. parametrically from an ilfitial configuration to one The user knows at the outset what the objects be- that satisfies the specified constraints. ing modeled are supposed to look like--how the pieces are supposed to fit together and move. The difficulty lies in • Animated models that, once assembled, may move in response to time-varying constraints while continuing finding settings of the parameters that achieve the desired effect. The utihty of hierarchic modefing systems would to satisfy static ones. be greatly enhanced if this tedious process could be per- • Oenerality and modularity: we can formulate a wide formed automatically, permitting the user to state in terms range of constraints as energy functions, and use them to influence arbitrary model parameters. To imple- Permission to copy without fee all or part of this material is granted ment a new constraint we need not know the details of provided that the copies are not made or distributed for direct other constraints, nor of the primitives and operators commercial advantage, the ACM copyright notice and the title of the to wtfich they will be applied. Sinfilarly, new parame- publication and its date appear, and notice is given that copying is by terized prinfitives and operators may be implemented permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission. without modifying existing constraints. • Additivity: Energy fimctions compose by addition. The solution to a system of constraints is the so- © 1987 ACM-O-89791-227-6/87 /O07/0225 $00.75 225 ~'~~ SIGGRAPH '87, Anaheim, July 27-31, 1987 lution to a single equation, the sum of the energy condition we must satisfy is Pl = P2- A solution is a value terms. This property is particularly valuable in deal- of ~ such that all the imposed conditions are met. ing with overdetermined systems. While conventional Rather than solving the constraint equations alge- algebraic methods return no solution to an overdeter- braically, we formulate constraints as energy fimctions, and nfined system, the energy minimum is a "compronaise" move through parameter space according to the energy that is sometimes acceptable, nearly always informa- gradient. In general, to formulate an energy constraint, tive, and often easily repaired. we must construct a non-negative smooth function E('I') such that E((P) = 0 at all and olrly values of 'I' for which • Interactive control: since we satisfy constraints by the constraint is satisfied. The solutions to a set of n con- moving ttlrough a curve in parameter space, the initial straints are values of • such that constraint solving process can itself be animated, per- nfitting the user to assist the solver in escaping local it energy minima, resolving ambiguities, etc. E(~) y~ E,(~) o, i A significant body of work in constraint-based and dy- uanlics modeling for colnputer graphics is concerned with so to combine constraints, the corresponding energy terms the the specialized problem of animating articulated bod- are simply summed. We are free to express E in terms of ies, particularly hmnan and animal forms. These include position, normal, or implicit functions, or any other quan- Armstrong and Green, [1], Girard and Maciejewski, [6], tities that may be extracted from the model tree. and Wilhehns and Barksy [13]. Nelson's Juno editor em- Intuitively, energy constraints may be viewed as ploys non-linear geometric constraints in the context of a "forces" ttlat pull the parts of the model into the desired 2-D image editor. Dynanffc models of elastic bodies for configuration and hold them there, although they are not computer graphics are treated by Terzopoulos et al. in necessarily intended to be physically realistic forces. For [12]. Closest to ours in approach are Barzel and Barr's dy- instance, a simple attachment constraint nffght be imple- nauric constraints [3], although their current work focuses mented as a spring connecting the points, in which case we on constraining ttle motion of rigid bodies. have E.,,,.;,~,, = ,~ IP~(u~,v~) - ~(~2,w_)l-", II. Energy constraints where ~ is a spring constant, and the "force" vector in parameter space is ~TE.p,.i,,j. A model hierarchy is a tree that defines the model's geom- From an initial condition @0, the energy E is mini- etry through a collection of mathematical functions, three mized by numerically solving the differential equation of wlffch will concern us here. These are a parametric posi- tion function, la(u, v) that returns a 3-space point for each dF(t)/dt- rE, F(0) = ~0, (u,v) pair, a surface normalfunction, N(u,v), that returns a surface normal vector, and an irttplicit or inside-outside for a fixed point of the parameter-space curve F(t), i.e. a point at wtffch VE = 0. The solution is a local mini- function, I(X), that returns a scalar given a 3-space point, mum, Mthough it is not guaranteed to be a zero. Tiffs is such that I = 0 for points on the object's surface, I < 0 for a steepest descent method for solving ~TE - 0. points inside the object, and 1 > 0 for points outside the A variety of standard numerical methods may be used object. One such collection of functions is defined for each to solve the energy equation. The simplest of these, Euler's leaf iu the tree, and represents tile combined effects of the method, has prinfitive at the leaf and of all the operators on the path F(~;~I) - F(t) + h~TE, from that leaf to the root. Defiuitions of these functions are given in Appendix A. with h the step size. More sophisticated methods, such In generM, each primitive or operator possesses some as Gear's method [5] should be used to obtain accurate, real-valued paraineters, for instance the radius of a sphere, reliable results. Any solution method requires evaluation a translation vector, or the bend angle of a parameterized of ~TE. To do so, the suunned energy must be differenti- deformation. The position, normal and implicit functions ated with respect to each model parameter, which may be each depend on these parameters: when they change, ob- done numerically by varying each parameter in turn, re- jects' surfaces move. We refer to the union of all these evaluating E, and taking differences. The structure of the parameters as ~I'. Once the hierarchic structure is fixed, tree may be used to avoid the needless expense of differen- the state of the model is completely determined by the tiating energy terms with respect to parameters on which v.-fiue of ~I'.