Vous êtes sur la page 1sur 10

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Introduction to Animation Computer Animation


Animation is the illusion of continuous movement of objects or camera viewpoint created by a series of still images

Each still image is called a frame. Most people perceive motion as smooth (continuous) when presented by a sequence of images at a rate of at least 10 frames per second.

Types of Animation
No rigorous classification of computer animation exists. However, the following non-exclusive terms are used to label different types of animation: Real time animation: an animation is real time if a computer is computing and displaying the animation at the same speed as it is designed to be seen at. Typically only simple animations can be displayed in real time. Keyframe animation: a technique for producing animations whereby important positions, sizes and orientations of objects at particular points in time are identified and everything else in-between is filled in by interpolation. Character animation: animation focussed on the display of expressions, emotions and behaviours normally associated with intelligent life forms.

1 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Motion path animation: a technique where objects or cameras move along a path. Hierarchical animation: animation of hierarchical objects. Shape animation: there are various forms but the most well known is morphing where one shape changes into another shape Procedural animation: animations typically require considerable data in their production. Procedural animation aims to compute animation data rather than have an animator specify it. Simulation: may be characterised as scientific animation. Typically simulations will be using data computed from the laws of physics. Camera animation: typified by architectural walkthroughs. In its pure form the only thing which moves is the camera.

Keyframing
An animation consists of a sequence of images. The keyframe technique consists of identifying certain arrangements of objects, including the camera, which are to hold at certain times or frames. Then the rest of the frames in the animation are worked out by in-betweening or "tweening". This consists of interpolating appropriate transformation parameters between specified keyframes.

2 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Keyframe Animation Using GLUT


3 of 10 03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Example: robot-anim.c, Redbook robot arm example with keyframe animation

The approach to performing animation using GLUT and OpenGL is as follows Write an idle or animate function which possibly together with other functions implements a simple animation engine The animation engine computes the keyframe animation using some type of interpolation or other technique Register the idle/animate function as a GLUT callback via glutIdleFunc GLUT arranges for the idle function to be called whenever nothing else needs doing The animation engine calls glutGet(GLUT_ELAPSED_TIME) to get the amount of elapsed time (c.f. cpu time) the program has been running The animation engine calls glutPostRedisplay after performing its calculations to schedule a redraw, but does not do the redraw itself Results in maximum frame rate, but possibly 100% utilisation

Parameter Curves
The most general approach to specifying parameter values being interpolated in an animation is to provide continuous curves for them.

4 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Or if using linear interpolation

The issue which then arises is how the animator can design or specify the curves. One obvious approach is to allow an animator to interactively edit the curves or at least change the values of keyframes This is used in conjunction with motion playback, where the animation is performed in real time by degrading the rendering (using say wireframes or simple shading) and/or culling parts of the scene. In this approach the animator should also be able to save and retrieve parameter curves which achieve certain effects. With this approach libraries of common curves can be built. For example, one common curve is referred to as "ease in-out".

Interpolation
In order to perform in-betweening, interpolation of values of parameters specified in keyframes is required.

5 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

The simplest form of interpolation is linear interpolation.

The linearly interpolated value of a parameter specified by two points (t1, v1) and (t2, v2) at arbitrary time t in the range [t1, t2]

is v = (t - t1)/(t2 - t1)*(v2 - v1) + v1 The robot-anim.c example uses linear interpolation, and has the above calculation in it Linear interpolation has problems when used for animation in that motion described by segments of linear interpolation is "jerky" and unrealistic. The jerkiness occurs because the rate of change of the parameter being interpolated is discontinous. To overcome this, and to achieve greater control and more entertaining effects, other types of interpolation may be used. Typically this is by using quadratic or cubic curve segments, that is, splines

6 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Morphing
Morphing is a type of shape animation One way is to think of morphing as keyframe animation applied to an entire mesh, i.e., to the position of all vertices of the mesh A mesh is made of polygons, in turn defined by vertices, so morphing is per-vertex animation Generally, can not achieve the same result by affine transformations (e.g, scale, translate, rotate)

Morph Targets
Define a base mesh/shape which is the natural or neutral situation or, for character animation, pose Can deform or reshape the base mesh by moving some or all vertices

7 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

Define different morph targets (called shape keys in Blender) as deformations of the original base mesh, or using an already deformed mesh Morph targets, like keyframes, may be extremities or inflexions which try to capture the essentials of the animation, like facial expressions (smile, frown) in a facial animation, or poses for a body A smile animation is produced by interpolating between the base mesh and the smile mesh by interpolating each and every vertex position from the original neutral mesh to the corresponding smile mesh position over the smile animation time

Morph Target Weights


Can generalise the morphing approach by associating weights with each morph target at different (key) times. For example, a little smile is achieved by using a weight of 0.5 for the smile morph target, rather than a weight of 1.0 More generally, use a weighted sum of a set of morph targets to blend a mixed shape to display

8 of 10

03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

In a facial animation using a blended expression using morph target weights could for example, be part smile, part frown.

Motion Path Animation


In motion path animation the path which an object is to follow is specified. For instance a plane is to fly in a spiral around an airport until landing. In addition to the motion path a timing curve is specified. The timing (or velocity) curve indicates what percentage of the motion path is to be traversed by a given frame or time.

Hierarchical Object Animation


A hierarchical object may be animated using the above techniques, keyframe animation in particular Parameter curves or motion paths may be specified for each node in the hierarchy In a hierarchical object transformations along a branch are concatenated. This means that the transformation given by a parent node will affect its children. Thus the parameter curves or motion paths must be specified with this in mind. The flying logo is a familiar example of hierarchical animation where individual letters each have their own independent motion and the letters as a group, that is,
9 of 10 03/10/08 22:03

Introduction to Animation

file:///mnt/home/gl/gl-gentoo/subjects/cosc%7B118...

the logo also has motion.

Articulated Object Animation


An articulated hierarchical object is a hierarchical object made of rigid links (or bones) connected together at joints. The links are not able to extend or shrink. In an articulated object the only transformation possible at joints is rotation. However, a general transformation may be applied to the whole object. Two examples of articulated objects are (1) robots and (2) trucks Animation of articulated objects is performed using the techniques described above, except that only rotations at joints are used. Parameter curves are specified for the rotations occuring in each joint of the articulated object. These parameter curves are then used to update rotation values.

Forward versus Inverse Kinematics


The approaches to specifying an animation given above, where the animator details the motion which is to occur, is referred to as forward kinematics. In the forward kinematics approach, to make a robot catch a ball, the animator must specify the motion of the robot and the rotation of each of its joints. A different approach is inverse kinematics which is designed to improve productivity and relieve some of the low level tedium. For articulated objects in some cases it is possible to work out mathematically the transformations which result in a given joint (point) being in a certain place at a certain time. For instance, it is possible to use inverse kinematics to work out the transformations about a shoulder and an elbow in order that a (fixed) hand be in a certain position.

References
Micheal O'Rourke, Principles of Three-Dimensional Computer Animation : Modeling, Rendering, and Animating With 3d Computer Graphics, Revised Edition, Norton, 1998 Alan Watt and Mark Watt, Advanced Animation and Rendering Techniques, Addison Wesley, 1992 George Maestri, Digital Character Animation, New Riders, 1996 Blender. www.blender3d.org

10 of 10

03/10/08 22:03

Vous aimerez peut-être aussi