Graphics Reference
In-Depth Information
One example of such a system is AutoDesk's Maya. The scripting language is called MEL and there
is an associated animation language whose scripts are referred to as expressions [ 36 ] . Maya's interface
is written in MEL so anything that can be done using the interface can be done in a MEL script (with a
few exceptions). MEL scripts are typically used for scene setup. The scene is represented as a network
of nodes that is traversed each time the frame is advanced in a timeline.
Expressions create nodes in the network that are therefore executed each frame. The input to, and
output from, an expression node link to the attributes of other nodes in the scene. Object nodes have
attributes such as geometric parameters and normals. Transformation nodes have attributes such as
translation, rotation, and scale. A transformation node is typically linked to an object node in order
to transform the object data into the world coordinate system. Using expression nodes, the translation
of one object could, for example, affect the rotation of other objects in the scene. The sample script
below creates an expression that controls the z -rotation of the object named “slab” based on the
z -translation of a sphere named “sphere1.” During the first frame, translation values for the objects
are initialized. For each subsequent frame, two of the sphere's translation values are set as a function
of the frame number and the z -rotation of slab is set as a function of the sphere's z -translation value.
if (frame ¼¼ 1) {
slab1.translateY ¼ 0;
sphere1.translateX ¼ 25;
sphere1.translateY ¼ 15;
}
else {
sphere1.translateX ¼ 25*sin(frame/100);
sphere1.translateZ ¼ 25*cos(frame/100) 25;
slab1.rotateZ ¼ 10*sphere1.translateZ þ 90;
}
4.2.3 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.
Then a script, or other type of animation system, when it needs a value of the variable in its compu-
tation, passes the time variable to the 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 some systems to control the
articulation of linked appendages.
The use of avars, when an interactive system is provided to the user for inputting values or designing
the functions, allows a script-based animation language to incorporate some interaction during the
development of the animation. It also allows digitized data as well as arbitrarily complex functions
to be easily incorporated into an animation by associating these with a particular avar.
4.2.4 Graphical languages
Graphical representations, such as those used in the commercial Houdini system [ 32 ], represent an ani-
mation by a dataflow network (see Figure 4.7 ) . An acyclic graph is used to represent objects, opera-
tions, and the relationships among them. Nodes of the graph have inputs and outputs that connect to
Search WWH ::




Custom Search