DOC PREVIEW
UCSD CSE 169 - Blending & State Machines

This preview shows page 1-2-3-4-5-36-37-38-39-40-72-73-74-75-76 out of 76 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 76 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Blending & State MachinesIssuesBlending & SequencingSlide 4Keyframe ChannelsKeyframe AccessChannel::Precompute()Computing TangentsFlat TangentsLinear TangentsSmooth TangentsStep TangentComputing Cubic CoefficientsSlide 14Channel::Evaluate()Finding the SpanFinding the Span: Binary SearchFinding the Span: Linear SearchEvaluating the CubicHigh Performance ChannelsRobustnessProject 3ReferencesAnimation PlaybackPosesAnimation ClipAnimation PlayerSlide 28Slide 29Slide 30Slide 31Slide 32Animation BlendingBlending OverviewGeneric Blend OperationCross DissolveSlide 37Cross Dissolve: Handling AnglesCross Dissolve: QuaternionsCross Dissolve: Stand to WalkSlide 41Cross Dissolve: Walk to RunSlide 43Slide 44Slide 45Slide 46Slide 47Basic Math Blend OperationsSlide 49Add & Subtract BlendersScale BlenderMath Operations: Body TurnBody TurnSlide 54Bilinear BlendSlide 56Slide 57Combine BlenderMirror BlenderClamp BlenderMulti-Track BlendingAnimation State MachinesState MachinesSlide 64Slide 65Simple Jump State MachineMore Complex JumpState Machine (Text Version)State Machine ExtensionsCreating State MachinesCharacter MoverSlide 72Slide 73Character Mover: WalkingSlide 75Slide 76Blending & State MachinesCSE169: Computer AnimationInstructor: Steve RotenbergUCSD, Winter 2004IssuesThe midterm is next ThursdayProject 1 sample on the web pageHopefully, I will have some morph files and texture examples on the web page by tomorrowStill grading project 1Blending & 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…)Keyframe ChannelsKeyframe Accessclass Keyframe {float Value,Time;char RuleIn,RuleOut;float TangentIn,TangentOut;float A,B,C,D;}class Channel {float Evaluate(float time);void Precompute();}Channel::Precompute()The two main setup computations a keyframe channel needs to perform are:Compute tangents from rulesCompute cubic coefficients from tangents & other dataThis can be done in two separate passes through the keys or combined into one pass (but keep in mind there is some slightly tricky dependencies on the order that data must be processed if done in one pass)Computing TangentsBoth the incoming and outgoing tangents need to be generated for each keyframeTangents are generated from simple ‘rules’Flat: tangent = 0Fixed: tangent = some constantLinear: tangent points to next/last keySmooth: tangent equals slope formed by next & last keyThe first two are trivial, the third is simple, and the fourth is pretty simple too…Note: I use ‘v’ for tangents (velocity) instead of ‘t’ which is used for timeFlat TangentsFlat tangents are particularly useful for making ‘slow in’ and ‘slow out’ motions (acceleration from a stop and deceleration to a stop)••••v = 0Linear Tangents••(p0,t0)v0outv1in(p1,t1)010110ttppvvinoutSmooth Tangents•(p1,t1)v1outv1in020211ttppvvoutin••(p2,t2)(p0,t0)Keep in mind that this won’t work on the first or last tangent (just use the linear rule)Step TangentOccasionally, one comes across the ‘step’ tangent ruleThis is a special case that just forces the entire span to a constantThis requires hacking the cubic coefficients (a=b=c=0, d=p0)It can only be specified on the outgoing tangent and it nullifies whatever rule is on the next incoming tangent••••Computing Cubic CoefficientsOnce we have the tangents for every keyframe, we can compute the cubic coefficients (a,b,c,d) for each spanUsually, these are just stored with the keyframe at the start of the span  101001100001010012331122vttvttppdcbaHrmHrmGBC Computing Cubic CoefficientsNote: My matrix34 class won’t do this properly!Tough! Do it yourself! Actually, all of the 1’s and 0’s in the matrix make it pretty easy to multiply it out by hand  101001100001010012331122vttvttppdcbaChannel::Evaluate()The Channel::Evaluate function needs to be very efficient, as it is called many times while playing back animationsThere are two main components to the evaluation:Find the proper spanEvaluate the cubic equation for the spanFinding the SpanAssuming we are doing a ‘random access’ of the channel, we need to first locate where the specified t value isThere are 4 main possibilitiest < tstart (before first key: use extrapolation)t > tend (after last key: use extrapolation)t is on a keyt is on a span between keys (most likely)Finding the Span: Binary SearchA very reasonable way to find the key is by a binary search. This allows pretty fast (log N) access time with no additional storage cost (assuming keys are stored in an array (rather than a list))Binary search is sometimes called ‘divide and conquer’ or ‘bisection’For even faster access, one could use hashing algorithms, but that is probably not necessary, as they require additional storage and most real channel accesses can take advantage of coherence (sequential access)Finding the Span: Linear SearchOne can always just loop through the keys from the beginning and look for the proper spanThis is an acceptable place to start, as it is important to get things working properly before focusing on optimizationIt may also be a reasonable option for interactive editing tools that would require key frames to be stored in a linked listOf


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?