• Tidak ada hasil yang ditemukan

Animation Languages

Dalam dokumen Computer Animation (Halaman 140-144)

Interpolation and Basic Techniques

3.6 Animation Languages

120        3: Interpolation and Basic Techniques

Various strategies can be used to define the intermediate curve segment, C(t) in Figure 3.53, and are typically applications of surface patch techniques. For exam- ple, tangent information along the curves can be extracted from the curve defini- tions. The endpoint and tangent information can then be interpolated along the top and bottom interpolation boundaries to define an intermediate curve.

Animation Languages 121

tion language is that it is, fundamentally, a programming language and thus requires the user (animator) to be a programmer. The animator must be trained not only in the arts but also in the art of programming. Languages have been developed with simplified programming constructs, but such simplification usu- ally reduces the algorithmic power of the language. As users become more familiar with a language, the tendency is to want more of the algorithmic power of a gen- eral-purpose programming language put back into the animation language. More recently, animation systems have been developed that are essentially user interfaces on top of a scripting language. Users can use the system strictly from the interface provided with the system, or they can write their own scripts in the underlying language. One example of such a system is Alias/Wavefront’s MEL. MEL provides variables, control statements, procedures, expressions, access to object attributes, and the ability to customize the user interface. The standard user interface protects users who do not know how to program or who do not want to use the underlying language while giving access to the full power of the scripting language to those users who wish to use it. A sample MEL script is shown below [1].

global proc emitAway() {

emitter -pos 0 0 0 -type direction -sp 0.3 -name emit -r 50 -spd 1;

particle -name spray;

connectDynamic -em emit spray connectAttr emit.tx emitShape.dx;

connectAttr emit.ty emitShape.dy;

connectAttr emit.tz emitShape.dz;

rename emit “emitAway#”;

rename spray “sprayAway#”;

}

3.6.1 Artist-Oriented Animation Languages

To accommodate animators not trained in the art of computer programming, sev- eral simple animation languages were designed from the ground up with the inten- tion of keeping the syntax simple and the semantics easy to understand (e.g., [18]

[19] [27]). In the early days of computer graphics, almost all animation systems were based on such languages because there were few artists with technical back- grounds who were able to program in a full-fledged programming language. These systems, as well as some of those with graphical user interfaces (e.g., [15] [29]

[39]), were more accessible to artists but also had limited capabilities.

In these simple animation languages, typical statements referred to named objects, a transformation, and a time at which (or a span of time over which) to

122        3: Interpolation and Basic Techniques

easy to parse (for the interpreter/compiler) and easy to read (for the animator).

The following examples are from ANIMA II [18].

set position <name> <x> <y> <z> at frame <number>

set rotation <name> [X,Y,Z] to <angle> at frame <number>

change position <name> to <x> <y> <z> from frame <number> to frame <number>

change rotation <name> [X,Y,Z] by <angle> from frame <number> to frame <number>

Specific values or variable names could be placed in the statements, which included an indicator as to whether the transformation was relative to the object’s current position or absolute in global coordinates. The instructions operated in parallel; the script was not a traditional programming language in that sense.

As animators became more adept at writing animation scripts in such lan- guages, they tended to demand that more capability be incorporated into the language. As May [28] points out, “By eliminating the language constructs that make learning animation languages difficult, command [artist-oriented] languages give up the mechanisms that make animation languages powerful.” The developers found themselves adding looping constructs, conditional control statements, ran- dom variables, procedural calls, and data structure support. It usually became clear that adding support for graphical objects and operations to an existing language such as C or LISP was more reasonable than developing a full animation program- ming language from scratch.

3.6.2 Articulation Variables

A feature used by several languages is associating the value of a variable with a function, most notably, of time. The function is specified procedurally or designed interactively using interpolating functions. Thus a script or other type of anima- tion system, when needing a value of the variable in its computation, passes the time variable to the articulation function, which returns its value for that time to the computation. This technique goes by a variety of names, such as track, channel, or articulation variable. The term articulation variable, often shortened to avar, stems from its common use in various systems to control the articulation of linked appendages.

The use of avars when an interactive system is provided to the user for designing the functions allows a script-based animation language to incorporate some interac- tion during the development of the animation. It also allows digitized data as well as arbitrarily complex functions to be easily incorporated into an animation.

Animation Languages 123

3.6.3 Graphical Languages

Graphical representations, such as those used in the commercial Houdini system [38], represent an animation by a dataflow network. See Figure 3.54 (Plate 2). An acyclic graph is used to represent objects, operations, and the relationships among them. Nodes of the graph have inputs and outputs that connect to other nodes, and data are passed from node to node by arcs of the graphics that are interactively specified by the user. A node represents an operation to perform on the data being passed into the node, such as an object description. A transformation node will operate on an object description passed into the node and will produce a trans- formed object representation as output. Inputs to a node can also be used to parameterize a transformation or a data generation technique and can be set inter- actively, set according to an articulation variable, or set according to an arbitrary user-supplied procedure.

3.6.4 Actor-Based Animation Languages

Actor-based languages are an object-oriented approach to animation in which an actor (encapsulated model [28]) is a graphical object with its associated data and

Figure 3.54 Sample Houdini dataflow network and the object it generates

124        3: Interpolation and Basic Techniques

procedures, including geometric description, display attributes, and motion con- trol. Reynolds [34] popularized the use of the term actor in reference to the encap- sulated models he uses in his ASAS system.

The basic idea is that the data associated with a graphical object should not only specify its geometry and display characteristics but also describe its motion. Thus the encapsulated model of a car includes how the doors open, how the windows roll down, and, possibly, the internal workings of the engine. Communication with the actor takes place by way of message passing; animating the object is car- ried out by passing requests to the actor for certain motions. The current status of the actor can be extracted by sending a request for information to the actor and receiving a message from the actor.

Actor-based systems provide a convenient way of communicating the time- varying information pertaining to a model. However, the encapsulated nature of actors with the associated message passing can result in inefficiencies when they are used with simulation systems in which all objects have the potential to affect all others.

Dalam dokumen Computer Animation (Halaman 140-144)