DOC PREVIEW
UCSD CSE 169 - Blending & State Machines

This preview shows page 1-2-3-4-26-27-28-53-54-55-56 out of 56 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 56 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Blending & State MachinesBlending & SequencingSlide 3Animation PlaybackPosesAnimation ClipAnimation PlayerSlide 8Slide 9Slide 10Slide 11Slide 12Animation BlendingBlending OverviewGeneric Blend OperationCross DissolveSlide 17Cross Dissolve: Handling AnglesCross Dissolve: QuaternionsCross Dissolve: Stand to WalkSlide 21Cross Dissolve: Walk to RunSlide 23Slide 24Slide 25Slide 26Slide 27Basic Math Blend OperationsSlide 29Add & Subtract BlendersScale BlenderMath Operations: Body TurnBody TurnSlide 34Bilinear BlendSlide 36Slide 37Combine BlenderMirror BlenderClamp BlenderMulti-Track BlendingAnimation State MachinesState MachinesSlide 44Slide 45Simple Jump State MachineMore Complex JumpState Machine (Text Version)State Machine ExtensionsCreating State MachinesCharacter MoverSlide 52Slide 53Character Mover: WalkingSlide 55Slide 56Blending & State MachinesCSE169: Computer AnimationInstructor: Steve RotenbergUCSD, Winter 2005Blending & SequencingNow that we understand how a character rig works and how to manipulate animation data, we can edit and play back simple animationThe subject of blending and sequencing encompasses a higher level of animation playback, involving constructing the final pose out of a combination of various inputsWe will limit today’s discussion to encompass only pre-stored animation (channel) data as the ultimate input. Later, we will consider how to mix in procedural animation…Blending & SequencingMost areas of computer animation have been pioneered by the research and special effects industriesBlending and sequencing, however, is one area where video games have made a lot of real progress in this area towards achieving interactively controllable and AI characters in complex environments…The special effects industry is using some game related technology more and more (battle scenes in Lord of the Rings…)Animation PlaybackPosesA pose is an array of values that maps to a rigIf the rig contains only simple independent DOFs, the pose can just be an array of floatsIf the rig contains quaternions or other complex coupled DOFs, they may require special handling by higher level codeTherefore, for generality, we will assume that a pose contains both an array of M≥0 floats and an additional array of N≥0 quaternions 1010......NMqqAnimation ClipRemember that the AnimationClip stores an array of channels for a particular animation (or it could store the data as an array of poses…)This should be treated as constant data, especially in situations where multiple animating characters may simultaneously need to access the animation (at different time values)For playback, animation is accessed as a pose. Evaluation requires looping through each channel.class AnimationClip {void Evaluate(float time,Pose &p);}Animation PlayerWe need something that ‘plays’ an animation. We will call it an animation play erAt it’s simplest, an animation player would store a AnimationClip*, Rig*, and a float timeAs an active component, it would require some sort of Update() functionThis update would increment the time, evaluate the animation, and then pose the rigHowever, for reasons we will see later, we will leave out the Rig* and just have the player generate and output a PoseAnimation Playerclass AnimationPlayer {float Time;AnimationClip *Anim;Pose P;public:void SetClip(AnimationClip &clip);const Pose &GetPose();void Update();};Animation PlayerA simple player just needs to increment the Time and access the new pose once per frameThe first question that comes up though, is what to do when it gets to the end of the animation clip?Loop back to startHold on last frameDeactivate itself… (return 0 pose?)Send a message…Animation PlayerSome features we may want to add for a more versatile animation player include:Variable playback ratePlay backwards (& deal with hitting the beginning)PauseIt’s kinda like a DVD player…Animation PlayerThe animation player is a basic component of an animation blending & sequencing systemMany of these might ultimately be combined to get the final blended pose. This is why we only want it to output a poseBy the way, remember the issue of sequential access for keyframes? The animation player should ultimately be responsible for tracking the current keyframe array (although the details could be pushed down to a specific class for dealing with that)Animation PlayerAs we will use players and static poses as basic components in our blending discussion, we will make a notation for them:look_right walkcurrent pose(Animation Player)static poseAnimation BlendingBlending OverviewWe can define blending operations that affect posesA blend operation takes one or more poses as input and generates one pose as outputIn addition, it may take some auxiliary data as input (control parameters, etc.)Generic Blend OperationBLENDERauxdatapose1 ...poseNoutput poseCross DissolvePerhaps the most common and useful pose blend operation is the ‘cross dissolve’Also known as: Lerp (linear interpolation), blend, dissolve…The cross dissolve blender takes two poses as input and an additional float as the blend factor (0…1)Cross DissolveThe two poses are basically just interpolatedThe DOF values can use Lerp, but the quaternions should use the ‘Slerp’ operation (spherical linear interpolate)        21212121sinsinsin1sin,,1,,qqqqqtttSlerptttLerpCross Dissolve: Handling AnglesIf a DOF represents an angle, we may want to have the interpolation check for crossing the +180 / -180 boundaryUnfortunately, this complicates the concept of a DOF (and a pose) a bit more. Now we must also consider that some DOFs behave in different ways than others       2121122121,, 360,, 180 ,360, 180tLerpelsetLerpifelsetLerpifCross Dissolve: QuaternionsAlso, for quaternions, we may wish to force the interpolation to go the ‘short way’:    212121,, ,, 0qqqqqqqqtSlerpel setSle rpifCross Dissolve: Stand to WalkConsider a situation where we want a character to blend from a stand animation to a walk animationDISSOLVEoutput posefstand walkCross Dissolve: Stand to WalkWe could have two independent


View Full Document

UCSD CSE 169 - Blending & State Machines

Download Blending & State Machines
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Blending & State Machines and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Blending & State Machines 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?