Maths & Technologies for Games Animation: Practicalities CO3303 Week 3.

Slides:



Advertisements
Similar presentations
Animation in Video Games presented by Jason Gregory
Advertisements

Blending & State Machines CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
1 Characters. 2Introduction The Characters are the Actors of the Games. The Characters are the Actors of the Games. Three Types of Characters : Three.
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.
Multimedia System and Networking UTD Slide- 1 University of Texas at Dallas B. Prabhakaran Blending & State Machines.
SE 313 – Computer Graphics Lecture 14: Armatures Lecturer: Gazihan Alankuş 1.
Character Setup Character Setup is the process of creating handles and controls for anything that a character animator will need to adjust in order to.
CA0932a Multimedia Development Lecture 11 Animation Techniques Principles in Flash.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
Outline for Today More math… Finish linear algebra: Matrix composition
3D orientation.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Now Playing: Gong Sigur Rós From Takk... Released September 13, 2005.
Animation. Outline  Key frame animation  Hierarchical animation  Inverse kinematics.
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Rotation and Orientation: Affine Combination Jehee Lee Seoul National University.
Week 4 Lecture 3: Character Animation Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley.
CSE 473 Dr. Charles B. Owen Fundamentals of 3D Game Development1 Skeletons and Skinning Bones and Skeletons Mesh Skinning.
Characters.
1 KIPA Game Engine Seminars Jonathan Blow Seoul, Korea December 7, 2002 Day 11.
Chapter 5.2 Character Animation. CS Overview Fundamental Concepts Animation Storage Playing Animations Blending Animations Motion Extraction Mesh.
Mathematical Fundamentals
Collision and Animation Systems in Games Jani Kajala Lead Programmer / Chief Technology Officer, Pixelgene Ltd (0)
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
CSC418 Computer Graphics n Animation Principles n Keyframe Animation.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Maths and Technologies for Games Quaternions CO3303 Week 1.
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.
IT253: Computer Organization
Computer Graphics Soft Body Animation - Skinning CO2409 Computer Graphics Week 22.
Animation Basics. A) Animation In animation we attempt to make things that aren’t really there appear as though they could actually exist and move in.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
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.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Math Review.
Computer Graphics Matrix Hierarchies / Animation
CS 450: COMPUTER GRAPHICS ANIMATION SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics Basic Maths for Graphics in C++ CO2409 Computer Graphics Week 4.
Rick Parent - CIS681 Motion Capture Use digitized motion to animate a character.
Skeletal Animation and Skinning A (hardware friendly) software approach By: Brandon Furtwangler.
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Computer Graphics Matrices
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Advanced Math.
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.
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CSCE 552 Fall 2012 Animations By Jijun Tang.
UW Extension Certificate Program in Game Development 2nd quarter: Advanced Graphics Animation.
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Skeletons and Skinning
Computer Animation and Visualisation Lecture 4. Skinning
Chapter 5.2 Character Animation
GAM 325/425: Applied 3D Geometry
UMBC Graphics for Games
Prepared by: Engr . Syed Atir Iftikhar
UMBC Graphics for Games
Advanced Games Development Game Physics
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Computer Graphics Matrix Hierarchies / Animation
Emerging Technologies for Games Review & Revision Strategy
Presentation transcript:

Maths & Technologies for Games Animation: Practicalities CO3303 Week 3

Today’s Lecture 1.Animation Issues 2.Transformation Decomposition 3.Keyframes 4.Interpolation Revisited 5.Playing Animations 6.Blending Multiple Animations 7.Motion Extraction

Animation Issues We have seen a method to interpolate a model’s pose between keyframes Surely we can now build an animation system? No –Several major practicalities to deal with –Need further refinements to the previous theory

Animation Issues Assume our game has: –30 characters with 64 bones, 60 animations each –Animations are 5 seconds long, store 8 keyframes / s Memory usage = 30*64*60*5*8* sizeof(keyframe) If our keyframe is a 4x4 matrix then = 295Mb If a quaternion, position and scaling, then = 184Mb –Too much memory used Implies poor cache performance Can improve on this

Animation Issues Sometimes need to play more than one animation at the same time –E.g. Character running and firing a gun –Or character standing and firing –Would like to blend the firing animation with the character’s other motion – 2 animations at once –Simple interpolation insufficient Also, how to combine movement in the scene with movement in the animation? Will look briefly at several practical animation techniques to address these issues

Transformation Decomposition Each bone in a model has a separate transform –Each relative to its parent, forming a hierarchy Last year we used matrices for this hierarchy Now we have seen that matrices are not a good choice for animation in general –Expensive to interpolate & too much storage So we decompose the transform into: –Rotation, translation, scale etc. Use vectors for translation and scale Quaternions for rotation

Transformation Decomposition Can write a quaternion-based transformation class –With the same functionality as a matrix class –But able to interpolate rotations efficiently Use for current transformations of animated models – one for each bone in hierarchy However, when storing keyframes, we can remove uneeded elements –E.g. no scaling – don’t store scaling Will reduce the storage by 40% or so

Key frames authored by artists –Based on needs of animation Must make sure it suits our needs too: –Rotations small enough for interpolation method (e.g. nlerp) –No unsupported components (e.g. shear) All bones key-framed at once or independently Key Frames Might pre-process keyframes: –Precalculate values (e.g. sin θ ) –Add extra frames to improve motion when using approximations

Interpolation Revisited Choices with interpolation: –Use lerp or normalised lerp (nlerp) always –Or use slerp sometimes –Or use slerp approximations (sometimes) First choice can be the best –Unless there are large angular movements in your animation (rare) Less than 5% inaccurate for < 45 degrees nlerp

Higher Order Interpolation We may wish to use more complex interpolations: –To produce smooth curves Higher order interpolation needs less key frames –Up to ten times less –Only a little extra data –Overall greatly aids our memory problem Example: cubic Bezier curve formula Use as a replacement for linear interpolation –Needs extra points to define curve

Playing Animations Each animation has a length –Usually measured in seconds Within that time there will be several key frames –Around 0.5 to 8 per second - may not be evenly spread Our model will know its current animation position –E.g. 1.2 seconds into an 2 second walk animation Need a fast method to extract the which key frames are needed at this point –Need the frame before, the frame after and the interpolation value t

Playing Animations For each animation store a single structure: –Number of bones in animation –Length (in seconds) –Key frame data When a model plays an animation it stores an additional structure: –Pointer to the animation it is using –Current position (time) in the animation Can be converted to key frames + t value –Speed of playback This way several models can use the same animation at the same time

Blending Animations Game characters often do several things at once: –E.g. Running and shooting Many animations only use part of the body –E.g. A waving animation Like to use different animations at the same time And/or apply them only to parts of the body Possible with further linear interpolation of several animations: –A first lerp to get pose 1, a second lerp to get pose 2 –Then a final lerp to blend these two together

Multiway Blending Can add weightings to the animations: FinalPose = Pose1 * w1 + Pose2 * w2 –If w1>w2, then Pose1 is more prominent –Almost identical to quaternion and vector linear interpolation from last week Can blend more than two animations too This is called multiway blending Uses: –Smoothly changing from a run to a walk –Different animations for legs and upper body –Separate facial animations –All of the above happening at the same time

Bone Masks Can also have per-bone weights for blending animations - called a bone mask For a waving animation, the bones in the arm would have a weight of 1.0 –The animation fully affects the arm The rest of the body would have 0.0 –No effect on the body –Don’t need to store key frames for these parts The shoulder would have a weight of 0.5 –Blending the waving animation with any underlying animation

Motion Extraction A run animation actually moves the character in the scene – even if our model is stationary How to match the motion stored in the animation and the position of our models? Use motion extraction techniques, generally: –Analyse movement of a root bone in the animation –Subtract that motion from the animation – so the animation doesn’t move –Replicate the movement onto our actual scene model The result will look the same, but with the scene model tracking the animation root

Animation Summary Many aspects to a full animation system –A very intricate areas of games development Only able to touch upon the issues in the time available here –Matrices, quaternions, interpolation are just the building blocks Look at simple, but functional system in the labs In the real world you will find more complex systems in use –But with the same principles