220 likes | 232 Views
Advanced Computer Graphics: Animation. James Gain Department of Computer Science University of Cape Town jgain@cs.uct.ac.za. Objectives. To introduce the field of computer animation. To describe the principal methods of parametric animation, motion capture and physical dynamics.
E N D
Advanced Computer Graphics:Animation James Gain Department of Computer ScienceUniversity of Cape Town jgain@cs.uct.ac.za Advanced Computer GraphicsCollaborative Visual Computing Laboratory
Objectives • To introduce the field of computer animation. • To describe the principal methods of parametric animation, motion capture and physical dynamics. • To cover the animation of articulated figures. • To show how Quaternion rotations address the animation problems with Euler angle rotations. Advanced Computer Graphics
Computer Animation • Animation creates the illusion of life by showing strobed discrete images which the human visual system reconstructs using persistence of vision into a continuous sequence. • Computer animation controls the position and attributes of all virtual entities over time. • Widely used in simulation. • Temporal aliasing occurs if an animation changes too quickly relative to the frame rate. For example: objects moving rapidly across the field of view, bicycle wheels which appear to turn backwards. • Modelling specifies the geometry. Rendering determines visual appearance. Animation determines evolution over time. Advanced Computer Graphics
Hand-Drawn Animation • Created in a fairly fixed sequence, called key-frame animation: • A storyboard is laid out, which roughly outlines the animation. Shows the structure and ideas of the story. • The soundtrack is recorded. • Key frames of the animation are drawn. These show extremes of action or characteristic expressions. • Intermediate frames are filled in by inbetweeners. Together with key frames these constitute a pencil test. • Pencil tests are transferred to cels (sheets of acetate film). • Each cel becomes a single frame in a film (60 frames per second). • The process is time consuming and expensive. Some principles are transferable to computer animation: squash and stretch; slow-in slow-out. Advanced Computer Graphics
Parameter-based Animation • Key-framing: Animators specify object parameters (position and orientation) at key frames. • Inbetweening: Intermediate frames generated by interpolation. • Animators have control over: • Path: Linear interpolation (Lerping) leads to discontinuous direction changes. Instead use Hermite curves. • Speed: a linear function is highly unrealistic. Slow-in Slow-out (smooth acceleration/ deceleration) is preferred Advanced Computer Graphics
Motion Capture • Real-world position and orientation of objects (particularly people) can be tracked and applied to computer generated characters. • Track predetermined points (called markers or sensors) on the moving entity in order to reconstruct the event digitally. • Capture systems are optical (cameras + markers), electromagentic (attached magnetic sources + receiver) or electromechanical (exoskeleton measuring bend angles). • Widely used in VFX (e.g. digital extras in “Titanic”). Advanced Computer Graphics
Physically-based Animation • Kinematics (object control): • Describes the position and velocity of points. • Forward example: at time the cube is at . Afterwards it moves with constant acceleration in direction . • Inverse example: find the constant velocity required for a cube to reach after seconds. Advanced Computer Graphics
Dynamics • Dynamics (cloth, water, fracture simulation): • Considers the physical laws (e.g. Newtonian mechanics, Navier-Stokes equations) governing kinematics. • Forward example: a cube has mass of grams. Gravity acts on the cube. • Inverse example: find the force required for a cube to reach after seconds. Advanced Computer Graphics
Exercise: Figure Animation • A Virtual Actor is the CG representation of a character’s motion and appearance. • Question: Why would we want to replace real with CG actors? • Solution: • Actor must react in real time (e.g. computer games) • Actor’s physical form is difficult to realize in reality (e.g. Jar-Jar Binks) • Actor must perform impossible or dangerous actions. • Actor is to be placed in a computer generated set (avoids green-screening) • Actor is a member of a crowd scene (cheap rent-a-crowd). • The real actor is unavailable (e.g. Marilyn Monroe in “Rendezvous A Montreal”). Advanced Computer Graphics
Skeletal Representation • Skeleton: • Encodes the degrees of motion freedom. • A set of rigid bones linked by ball (3DOF) and hinge (1DOF) joints • Shoulder blade cannot be represented by a single joint because of sliding action. • Spine has 33 vertebrae (96 DOF) which is unwieldy but, due to movement constraints, can be approximated by 2-3 ball joints. • The skeleton can be realized as a scene graph. Advanced Computer Graphics
Skeletal Transformations • Kinematics: • From a particular joint configuration calculate the relative position and orientation of any point on the skeleton. • Terminology: • Kinematic link (bone), Kinematic chain (sequence of bones and joints) and End-effector (last link, e.g. hand or foot). • Solution: • Each link has a local co-ordinate system and is embedded in a space provided by the previous link. • Each joint provides a local rotation and each bone a local translation . Concatenating and gives a local transform . • The transformation of a point on link is found by concatenating all previous transforms in the hierarchy: Advanced Computer Graphics
Inverse Kinematics • Specifying pose using joint angles is difficult. • Animators would prefer to position end-effectors directly. • Problem: • Given the position and orientation of an end-effector • Find all such that translates by and rotates by . • Underdetermined non-linear system with many solutions. • Example: a hand has constraints ( and ) and unknowns (clavicle , shoulder , elbow , wrist ). • Solutions: • Iterative methods: use small changes in joint angles to iteratively converge on a correct solution. • Closed form algebraic solutions: only exist for particular simplified cases. Advanced Computer Graphics
Reducing Kinematic Freedom • The degrees of kinematic freedom can be reduced by enforcing “realistic” motion. • Realism rules for human motion: • Motion tends to be energy minimal (but this doesn’t account for expressive gestures). • Collisions must not occur (muscles and skin surrounding the kinematic bones cannot intersect). • Joint limits must be maintained (e.g. elbows don’t bend backwards) • Feet in contact with the floor maintain their position unless lifted. • Solutions which obey these realism rules are often even more difficult to find. Advanced Computer Graphics
Animation Summary Advanced Computer Graphics
Euler Angles • Historically popular but flawedparametrizationof orientation. • A general rotation is constructedas a sequence of rotations about3 mutually orthogonal axes:rolls about , and . • The order of the rolls is significant. • Arbitrarily choose the ordering . A roll about by , followed with a roll about by , and finally a roll about by . • Euler angle interpolation is not very stable. Especially with a small rotation in one axis and large rotation in another – multiplying large values by those close to zero tends to introduce numerical error. Advanced Computer Graphics
Gimbal Lock • A gimbal mechanism consists of three concentric rings on pivots which support a compass or gyroscope. • Gimbal lock occurs when two of the rings are accidentally aligned. • Euler angles are also susceptible. If one axis is rolled into alignment with another then a degree of rotation freedom is lost. • Unlike translations, rotations relative to separate axes are not independent. • Example: a -roll of rotates the -axis onto the-axis so that rolls about and are indistinguishable. Advanced Computer Graphics
Lerping Euler Angles • Two Euler rotations and can be linearly interpolated to obtain inbetween rotations: • Problems: • This does not produce a ‘natural’ steady rotation about a single vector but may instead cause weird oscillations. Reason: the rolls about are not independent. • The resulting interpolation differs depending on the ordering of the Euler angles. Reason: the rolls about are not commutative. Advanced Computer Graphics
Example: Poor Euler Interp • The interpolations and have the same start and end orientations but different intermediate orientations. Advanced Computer Graphics
Quaternions • Aim to: • Guarantee a direct and steady rotation between any two key orientations. • Define moves that are independent of any particular co-ordinate system. • Quaternions were invented by Sir William Hamilton, after 10 years of work, on 16 October 1843. In his elation he carved the formulae into the nearby Broome Bridge in Dublin. • They represent an orientation by a counter-clockwise rotation angle ( ) about an arbitrary vector ( ). • Advantages: • combining quaternions more efficient than matrix multiplication. • simple to convert between angle-axis, quaternion and transformation matrix representations of rotation. Advanced Computer Graphics
Form of a Quaternion • such that • are ‘imaginary’ axes ( are imaginary numbers) and is a ‘real’ axis. • and are co-ordinates relative to these four axes. • In 3D a point s.t. with co-ordinates and axes lies on a sphere of radius . • Similarly, for quaternions the rotation with lies on a 4D hypersphere of radius . Advanced Computer Graphics
Lerpingvs. Slerping Quaternions • Inbetweening key Quaternions and by linearly interpolating theircomponentsdoes not: • Produce equal changes in the quaternion for equal steps in . They speed up in the middle. • Ensure vectors remain on the hypersphere. Rather use spherical linear interpolation (Slerping) which step through a constant angle. Advanced Computer Graphics
Evaluating Quaternions • Advantages: • Flexible. • No parametrization singularities. • Smooth consistent interpolation of orientations. • Simple and efficient composition of rotations. • Disadvantages: • Each orientation is represented by two quaternions. • Represent orientations not rotations ( about is the same quaternion as about ). • Complex! • References: • Computer Graphics: Principles and Practice, sec. 21.1.3 Advanced Computer Graphics