Computer Science › Section K · Computer graphics › Topic K.5
Animation
Animation is a rapid sequence of still frames, and in 3D graphics each frame is a fresh rendering of a scene whose numbers have changed slightly. Animators set the important moments; interpolation, physics and joint models fill in the rest.
Frames and the illusion of motion
Animation shows a sequence of still images, called frames, quickly enough that viewers perceive continuous motion. Each frame captures the scene at one moment, at regular intervals. Cinema has long used 24 frames per second. Broadcast television standards vary by region: traditional North American video shows about 60 interlaced fields per second, each carrying alternate lines, which makes about 30 full frames, while many other countries used 25 frames per second. Games commonly aim for 30 or 60 frames per second. Frames can be photographed, computer-generated or both, as when software erases support wires from live footage.
Worked example: frames, render time and storage
Size up a 100-minute animated feature at 24 frames per second. 1. Seconds: 100 × 60 = 6,000. 2. Frames: 6,000 × 24 = 144,000. 3. Assume each frame takes 2 hours on one computer: the film needs 288,000 machine-hours, so a render farm of 1,000 machines working in parallel needs 288 hours, or 12 days. 4. An uncompressed 1920 × 1080 frame in 24-bit colour holds 6,220,800 bytes, so one second of film is 24 × 6,220,800 = 149,299,200 bytes, about 149 MB. 5. The whole film is 144,000 × 6,220,800 = 895,795,200,000 bytes, about 896 GB uncompressed. Check: each frame is on screen for about 41.7 ms, yet took 2 hours to make.
Storyboards, key frames and in-betweening
A project usually begins with a storyboard, a series of sketches showing the story at its key moments. In hand-drawn studios such as Disney's, senior animators turned the storyboard into key frames, drawings that fix the characters' poses at chosen moments, and assistants drew the frames between them, a job called in-betweening. Today software draws much 2D animation and produces many in-betweens automatically. In 3D animation the storyboard instead guides the building of a virtual world, which is then photographed again and again as its objects move.
Moving an object means changing numbers
In a 3D scene an object is data in the scene graph, including its position and orientation, so moving it means changing those values from frame to frame. Animators set values at key frames and the software computes the rest by interpolation. Linear interpolation between value \(a\) at frame \(f_0\) and \(b\) at frame \(f_1\) gives frame \(f\) the value
Linear motion starts and stops with a jolt, so animators use easing. A common choice replaces \(u\) with \(3u^2 - 2u^3\), which starts slowly, speeds up and slows down again; Bézier curves from "Modeling objects" often shape such timing too.
Worked example: in-betweening a ball
Key frames put a ball at \(x = 2\) m at frame 0 and \(x = 14\) m at frame 24. Find its position at frame 6. 1. \(u = (6 - 0)/(24 - 0) = 0.25\). 2. Linear: \(x = 2 + 0.25 \times 12 = 5\) m. 3. Eased: \(3(0.25)^2 - 2(0.25)^3 = 0.15625\), so \(x = 2 + 0.15625 \times 12 = 3.875\) m, still near the start and gathering speed. 4. At frame 12, \(u = 0.5\) and both methods give 8 m, the midpoint. 5. Check: at frame 18 the eased ball is at 12.125 m, as far below 14 as 3.875 is above 2, since the easing curve is symmetric. Rotations interpolate the same way: 90° over 30 frames is 3° per frame.
Morphing
Morphing makes one object appear to change into another. It starts from two key frames, the last image before the change and the first after it. Matching control points are marked on both, such as the corners of the eyes and mouth on two faces. For each in-between frame, every control point moves part of the way to its partner, the images are warped to follow the points, and their colours are blended in the same proportion. A point at (40, 60) in the first image and (100, 30) in the last sits at (64, 48) when \(u = 0.4\).
Dynamics: motion from physics
Two branches of mechanics automate motion. Dynamics computes motion from forces using the laws of physics. An object is given a mass, velocity and position, and each frame the software updates them: with \(g = 9.8\) m/s² and frame time \(\Delta t = 1/24\) s, first \(v \leftarrow v - g\Delta t\), then \(y \leftarrow y + v\Delta t\). A ball dropped from 10 m has \(v \approx -0.408\) m/s and \(y \approx 9.983\) m after one frame. Such stepping is approximate: after 24 frames it gives about 4.90 m, against the exact 5.1 m from the Physics topic "Falling objects", and smaller steps shrink the error. Particle systems use dynamics for water, smoke and debris.
Kinematics: motion from joints
Kinematics describes motion by how parts move relative to each other, without computing forces, which suits articulated figures. A character is rigged with a skeleton of bones and joints, covered by meshes that bend with it. The values an animator adjusts, such as joint angles, are avars, short for articulation or animation variables, and work like the strings of a puppet. Forward kinematics computes where a hand ends up from given joint angles. Inverse kinematics works backwards, finding angles that put the hand or foot on a target, as when a foot must land on a step.
Worked example: a two-joint arm
A shoulder is at the origin. The 30 cm upper arm is raised 30° above horizontal, and the elbow bends a further 45° to a 25 cm forearm. 1. Elbow: \((30\cos 30^\circ, 30\sin 30^\circ) \approx (25.98, 15.00)\). 2. The forearm's angle from horizontal is \(30^\circ + 45^\circ = 75^\circ\). 3. Hand: elbow plus \((25\cos 75^\circ, 25\sin 75^\circ)\), about \((25.98 + 6.47, 15.00 + 24.15) = (32.45, 39.15)\). 4. Check: the hand is about 50.8 cm from the shoulder, less than 30 + 25 = 55 cm, as it must be with the elbow bent. 5. Animating the elbow from 45° to 90° over 15 frames adds 3° per frame, and forward kinematics gives each frame's hand position.
Motion capture, crowds and motion blur
Motion capture records a real performer: markers on the body are filmed by several cameras, and their tracked positions drive a character's joints; some newer systems work without markers. Large crowd and battle scenes in films are often made from many simulated agents, each following rules plus some randomness, instead of thousands of extras. Perfectly sharp frames of a fast object can look jerky, so renderers add motion blur, for example by averaging images of the object at several moments within the frame's time, as the distributed ray tracing of "Global lighting: ray tracing and radiosity" does.
Common mistakes to avoid
First, forgetting to convert minutes to seconds before multiplying by the frame rate. Second, computing \(u\) as \(f / f_1\) instead of \((f - f_0)/(f_1 - f_0)\) when the first key frame is not frame 0. Third, adding the eased value to the wrong base: it scales \(b - a\) and is added to \(a\). Fourth, mixing up dynamics, which uses forces, with kinematics, which uses joint angles. Fifth, in forward kinematics, forgetting that the elbow angle adds to the shoulder angle. Sixth, thinking frame stepping is exact.
Key takeaways
Animation is a sequence of frames: 24 per second in cinema, commonly 30 or 60 in games. Work starts from a storyboard; key frames fix poses and in-betweening fills the gaps, now largely by interpolation, v = a + u(b − a), with easing for natural starts and stops. Moving an object means changing scene-graph values. Dynamics steps physics forward each frame; kinematics moves jointed skeletons through avars, forwards or inversely. Motion capture, crowd agents and motion blur add realism.
Flashcards
Flashcard
One still image in an animated sequence
Test your understanding
Question 1 of 5
How many frames does a 3-minute animated short need at 24 frames per second?
Question 2 of 5
A key frame sets y = 10 at frame 10 and another sets y = 40 at frame 30. Using linear interpolation, what is y at frame 16?
Question 3 of 5
Why do animators often replace linear interpolation with an easing curve such as 3u² − 2u³?
Question 4 of 5
Which task is best handled by kinematics rather than dynamics?
Question 5 of 5
A shoulder is at the origin. A 20 cm upper arm points along the positive x-axis, and the elbow bends 90° anticlockwise to a 10 cm forearm. Where is the hand?
