Chapter 5.2 Character Animation. CS 44552 Overview Fundamental Concepts Animation Storage Playing Animations Blending Animations Motion Extraction Mesh.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Animation in Video Games presented by Jason Gregory
COMP Robotics: An Introduction
GRAPP, Lisbon, February 2009 University of Ioannina Skeleton-based Rigid Skinning for Character Animation Andreas Vasilakis and Ioannis Fudos Department.
INNER WORKINGS OF UNITY 3D. WHAT WE ARE GOING TO COVER Intro to Unity Physics & Game Objects Cameras & Lighting Textures & Materials Quaternions and Rotation.
1 Characters. 2Introduction The Characters are the Actors of the Games. The Characters are the Actors of the Games. Three Types of Characters : Three.
Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
Chapter 5.2 Character Animation. 2 Overview Fundamental Concepts Animation Storage Playing Animations Blending Animations Motion Extraction Mesh Deformation.
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
Lecture 2: linear algebra, animation basics
1Notes  Assignment 0 marks should be ready by tonight (hand back in class on Monday)
Character Animation CSE 191A: Seminar on Video Game Programming Lecture 5: Character Animation UCSD, Spring, 2003 Instructor: Steve Rotenberg.
3D orientation.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi Most slides courtesy.
CSCE 590E Spring 2007 Animation and AI By Jijun Tang.
Animation. Outline  Key frame animation  Hierarchical animation  Inverse kinematics.
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
CSCE 590E Spring 2007 Animation By Jijun Tang. Rendering Primitives Strips, Lists, Fans Indexed Primitives The Vertex Cache Quads and Point Sprites.
Week 4 Lecture 3: Character Animation Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley.
Orientations Goal: –Convenient representation of orientation of objects & characters in a scene Applications to: – inverse kinematics –rigid body simulation.
CSE 473 Dr. Charles B. Owen Fundamentals of 3D Game Development1 Skeletons and Skinning Bones and Skeletons Mesh Skinning.
Animation CMSC 435/634. Keyframe Animation From hand drawn animation – Lead animator draws poses at key frames – Inbetweener draws frames between keys.
Algirdas Beinaravičius Gediminas Mazrimas.  Introduction  Motion capture and motion data  Used techniques  Animating human body  Problems  Conclusion.
Characters.
1 KIPA Game Engine Seminars Jonathan Blow Seoul, Korea December 7, 2002 Day 11.
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Visualizing Orientation using Quaternions Gideon Ariel; Rudolf Buijs; Ann Penny; Sun Chung.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Kinematic Linkages.
Computer Graphics Group Tobias Weyand Mesh-Based Inverse Kinematics Sumner et al 2005 presented by Tobias Weyand.
Introduction Tracking the corners Camera model and collision detection Keyframes Path Correction Controlling the entire path of a virtual camera In computer.
Rotations and Translations
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Character Animation for Realtime Applications Michael Putz Klaus Hufnagl Institute of Computer Graphics Graz University of Technology Austria.
Computer Graphics 2 In the name of God. Outline Introduction Animation The most important senior groups Animation techniques Summary Walking, running,…examples.
Character Animation. Contents Keyframe animation Mocap Smooth skin by vertex blending Rigging & retargeting Gait analysis (Ragdoll physics) Fall
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Algirdas Beinaravičius Gediminas Mazrimas.  Introduction  Motion capture and motion data  Used techniques  Animating human body  Problems  Conclusion.
Maths & Technologies for Games Animation: Practicalities CO3303 Week 3.
CSE 381 – Advanced Game Programming Animation Systems Jack Skellington, from The Nightmare Before Christmas.
CSCE 552 Fall 2012 Animations By Jijun Tang. Animation terms  frame – an image that is displayed on the screen, usually as part of a sequence.  pose.
CS-378: Game Technology Lecture #13: Animation Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Algirdas Beinaravičius Gediminas Mazrimas.  Introduction  Motion capture and motion data  Used techniques  Animating human body  Problems  Conclusion.
Character Setup In addition to rigging for character models, rigging artists are also responsible for setting up animation controls for anything that is.
1cs426-winter-2008 Notes  Will add references to splines on web page.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Math Review.
CSCE 552 Spring 2009 Animation By Jijun Tang. Inverse of 4x4.
Skeletal Animation and Skinning A (hardware friendly) software approach By: Brandon Furtwangler.
1cs426-winter-2008 Notes. 2 Kinematics  The study of how things move  Usually boils down to describing the motion of articulated rigid figures Things.
Spring 2014 CS274: Automatic Rigging
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
3D GRAPHICS RENDERING PIPELINE CS / TECHNICAL BACKGROUND PAGE 11.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Advanced Math.
2014 Animation Programming for Music Video Games Jessica Scott Harmonix Music Systems, Inc. October 10, 2014 #GHC
CGDD 4003 Character Animation. The Skeletal Hierarchy (aka the “rig”) Based on the concept of bones Each bone has exactly one parent Each bone has a transform.
CSCE 552 Spring 2010 Animation By Jijun Tang.
Character Animation Forward and Inverse Kinematics
COMPUTER GRAPHICS CHAPTER 35 CS 482 – Fall 2017 ANIMATION
CSCE 552 Fall 2012 Animations By Jijun Tang.
Bones Skeletal Unity-2D How & When
Skeletons and Skinning
Computer Animation and Visualisation Lecture 4. Skinning
Chapter 5.2 Character Animation
Chapter XIII Character Animation
Prepared by: Engr . Syed Atir Iftikhar
UMBC Graphics for Games
Types of Animation.
Rotation and Orientation: Affine Combination
Emerging Technologies for Games Review & Revision Strategy
Presentation transcript:

Chapter 5.2 Character Animation

CS Overview Fundamental Concepts Animation Storage Playing Animations Blending Animations Motion Extraction Mesh Deformation Inverse Kinematics Attachments & Collision Detection Conclusions

CS Fundamental Concepts Skeletal Hierarchy The Transform Euler Angles The 3x3 Matrix Quaternions Animation vs Deformation Models and Instances Animation Controls

CS Skeletal Hierarchy The Skeleton is a tree of bones –Often flattened to an array in practice Top bone in tree is the “root bone” –May have multiple trees, so multiple roots Each bone has a transform –Stored relative to its parent’s transform Transforms are animated over time Tree structure is often called a “rig”

CS The Transform “Transform” is the term for combined: –Translation –Rotation –Scale –Shear Can be represented as 4x3 or 4x4 matrix But usually store as components Non-identity scale and shear are rare –Optimize code for common trans+rot case

CS Euler Angles Three rotations about three axes Intuitive meaning of values But… “Euler Angles Are Evil” –No standard choice or order of axes –Singularity “poles” with infinite number of representations –Interpolation of two rotations is hard –Slow to turn into matrices

CS x3 Matrix Rotation Easy to use Moderately intuitive Large memory size - 9 values –Animation systems always low on memory Interpolation is hard –Introduces scales and shears –Need to re-orthonormalize matrices after

CS Quaternions Represents a rotation around an axis Four values is axis vector times sin(angle/2) w is cos(angle/2) No singularities –But has dual coverage: Q same rotation as –Q –This is useful in some cases! Interpolation is fast

CS Animation vs Deformation Skeleton + bone transforms = “pose” Animation changes pose over time –Knows nothing about vertices and meshes –Done by “animation” system on CPU Deformation takes a pose, distorts the mesh for rendering –Knows nothing about change over time –Done by “rendering” system, often on GPU

CS Model Describes a single type of object Skeleton + rig One per object type Referenced by instances in a scene Usually also includes rendering data –Mesh, textures, materials, etc –Physics collision hulls, gameplay data, etc

CS Instance A single entity in the game world References a model Holds current position & orientation –(and gameplay state – health, ammo, etc) Has animations playing on it –Stores a list of animation controls

CS Animation Control Links an animation and an instance –1 control = 1 anim playing on 1 instance Holds current data of animation –Current time –Speed –Weight –Masks –Looping state

CS Animation Storage The Problem Decomposition Keyframes and Linear Interpolation Higher-Order Interpolation The Bezier Curve Non-Uniform Curves Looping

CS Storage – The Problem 4x3 matrices, 60 per second is huge –200 bone character = 0.5Mb/sec Consoles have around 32-64Mb Animation system gets maybe 25% PC has more memory –But also higher quality requirements

CS Decomposition Decompose 4x3 into components –Translation (3 values) –Rotation (4 values - quaternion) –Scale (3 values) –Skew (3 values) Most bones never scale & shear Many only have constant translation Don’t store constant values every frame

CS Keyframes Motion is usually smooth Only store every n th frame –Store only “key frames” Linearly interpolate between keyframes –Inbetweening or “tweening” Different anims require different rates –Sleeping = low, running = high –Choose rate carefully

CS Higher-Order Interpolation Tweening uses linear interpolation Natural motions are not very linear –Need lots of segments to approximate well –So lots of keyframes Use a smooth curve to approximate –Fewer segments for good approximation –Fewer control points Bézier curve is very simple curve

CS The Bézier Curve (1-t) 3 F 1 +3t(1-t) 2 T 1 +3t 2 (1-t)T 2 +t 3 F 2 t=0.25 F1F1 T1T1 T2T2 F2F2 t=1.0 t=0.0

CS The Bézier Curve (2) Quick to calculate Precise control over end tangents Smooth –C0 and C1 continuity are easy to achieve –C2 also possible, but not required here Requires three control points per curve –(assume F2 is F1 of next segment) Far fewer segments than linear

CS Looping and Continuity Ensure C0 and C1 for smooth motion At loop points At transition points –Walk cycle to run cycle C1 requires both animations are playing at the same speed –Reasonable requirement for anim system

CS Playing Animations “Global time” is game-time Animation is stored in “local time” –Animation starts at local time zero Speed is the ratio between the two –Make sure animation system can change speed without changing current local time Usually stored in seconds –Or can be in “frames” - 12, 24, 30, 60 per second

CS Scrubbing Sample an animation at any local time Important ability for games –Footstep planting –Motion prediction –AI action planning –Starting a synchronized animation Walk to run transitions at any time Avoid delta-compression storage methods –Very hard to scrub or play at variable speed

CS Blending Animations Pos: The Lerp Rot: Quaternion Blending Methods >2 anims: Multi-way Blending Masking: Bone Masks, Masked Lerp Hierarchical Blending –Bring it all together …

CS Motion Extraction Moving the Game Instance –Linear Motion Extraction –Composite Motion Extraction –Variable Delta Extraction –The Synthetic Root Bone Animation Without Rendering

CS Moving the Game Instance Game instance is where the game thinks the object (character) is Usually just –pos, orientation and bounding box Used for everything except rendering –Collision detection –Movement –It’s what the game is! Must move according to animations

CS Animation Without Rendering Not all objects in the world are visible But all must move according to anims Make sure motion extraction and replay is independent of rendering Must run on all objects at all times –Needs to be cheap! –Use LME & CME when possible –VDA when needed for complex animations

CS Mesh Deformation Find Bones in World Space Find Delta from Rest Pose Deform Vertex Positions Deform Vertex Normals

CS Inverse Kinematics FK & IK Single Bone IK Multi-Bone IK –Cyclic Coordinate Descent Two-Bone IK IK by Interpolation

CS Attachments e.g. character holding a gun Gun is a separate mesh Attachment is bone in character’s skeleton –Represents root bone of gun Animate character Transform attachment bone to world space Move gun mesh to that pos+orn

CS Attachments (2) e.g. person is hanging off bridge Attachment point is a bone in hand –As with the gun example But here the person moves, not the bridge Find delta from root bone to attachment bone Find world transform of grip point on bridge Multiply by inverse of delta –Finds position of root to keep hand gripping

CS Collision Detection Most games just use bounding volume Some need perfect triangle collision –Slow to test every triangle every frame Precalculate bounding box of each bone –Transform by world pose transform –Finds world-space bounding box Test to see if bbox was hit –If it did, test the tris this bone influences

CS Conclusions Use quaternions –Matrices are too big, Eulers are too evil Memory use for animations is huge –Use non-uniform spline curves Ability to scrub anims is important Multiple blending techniques –Different methods for different places –Blend graph simplifies code

CS Conclusions (2) Motion extraction is tricky but essential –Always running on all instances in world –Trade off between cheap & accurate –Use Synthetic Root Bone for precise control Deformation is really part of rendering –Use graphics hardware where possible IK is much more than just IK algorithms –Interaction between algorithms is key