Motion Graphs By Lucas Kovar, Michael Gleicher, and Frederic Pighin Presented by Phil Harton Overview What Why Creating Using What are motion graphs? Directed graph representing a roadmap of motion data for a character Edges are clips of motion, some from the original motion capture, some generated as transitions A vertex defines 2 sets of motion clips where motions from one set can flow seamlessly into motions from the other A simple motion graph Jog Walk2 Run2/Jog Run2 Run2/Run2 Walk2/Walk1 Run1 Walk1/Walk1 Walk1 Jog/Walk1 Original motion data Walk1 Walk2 Jog Run1 Run2 Why do we want them? To better utilize motion capture data because it’s: Difficult to modify Time consuming and expensive Hard to use in animations without having captured the exact motion desired Building motion graphs Identify transition candidates Select transition points Eliminate problematic edges Identify transition candidates For each frame A, calculate its distance to each other frame B by basically measuring volume displacement Use a weighted point cloud formed over a window of k frames ahead of A and behind B, ideally from the character mesh Calculate the minimal weighted sum of squared distances between corresponding points, given that a rigid 2D transformation may be applied to the second point cloud Identify transition candidates Select transition points The previous step gave us all the local minima of the distance function for each pair of points Now we simply define a threshold and cut transition candidates with errors above it May be done with or without intervention Threshold level depends on type of motion – eg. walking vs. ballet Create transitions For each pair of frames Ai and Bj which fell under the distance error threshold, blend Ai through Ai+k-1 with Bj through Bj-k+1 Align frames with appropriate rigid 2D transformation Use linear interpolation to blend root positions Use spherical linear interpolation to blend joint rotations Treat constraints as binary flags – frames in first half of transition use A’s constraints, second half use B’s Transition tagged with union of A and B’s labels Create transitions Blend weight function Root position interpolation Joint rotation interpolation Eliminate problematic edges We want to get rid of: Dead ends – not part of a cycle Sinks – part of one or more cycles but only able to reach a small fraction of the nodes Logical discontinuities – eg. boxing motion forced to transition into ballet motion Goal is to be able to generate arbitrarily long streams of motion of the same type Eliminate problematic edges Each frame is associated with a set of 0 or more labels For each unique set of labels, form a subgraph of edges whose frames have exactly this set Find the strongly connected components (SCCs) – maximal set of nodes where there is a connecting graph walk between each ordered pair Discard all edges that aren’t in the largest SCC Give warning if: A set of labels has below a certain threshold of frames For any ordered pair of SCCs there is no way to get from the first to the second Using motion graphs We have a database of motion segments and mappings between them, now we want to find motion streams that conform to user specifications This is approached as a search problem, where the user specifies a non-negative scalar error function g(w,e) as well as a halting condition Total error of a path w defined as: Searching Goal is to find a complete graph walk that minimizes f(w) Use branch and bound – keep track of the best complete graph walk wopt and cut current branch when the error exceeds f(wopt) Works best when a tight lower bound is found early Use a greedy ordering heuristic – for a set of unexplored child nodes, select the one that minimizes g(w,c) Searching Even with branch & bound and ordering heuristic, search is still exponential Trade some optimality for speed by searching incrementally Find optimal graph walk of n frames, retain first m nodes and search again from the last retained node Their implementation used 80-120 for n (2.67 to 4 sec), 25-30 for m (~1 sec) Defining optimization criteria So how do you define g(w,e) to find your desired motion?? First, two guidelines: g should give some sort of guidance throughout the motion, not just evaluate the end result g should be no more restrictive than necessary – balance guiding search to a particular result with allowing it to consider many options Path synthesis The example application they present is to make a character travel along a specified path on the ground Basic strategy for g is to measure difference between actual path traveled and desired path P(s) is the point on P whose arc-length distance from the start is s s(ei) is the arc-length from frame 0 to frame i in edge e Path synthesis Potential problem if character stands still with no incentive to move, thereby accruing zero error Fix this by replacing s(ei) with t(ei), which forces a small amount of progress with each frame If we wish to require different types of motion, break the path into segments by type of motion desired during each part If character is within threshold distance from end of current path, allow search to consider motion edges of both types, otherwise just the type of the current path Allow only one type switch per path Path synthesis applications Interactive control User controls a character, motion clips are selected in real time High-level keyframing Animator decides what the character should do and where, rather than tedious keyframing Motion dumping Same as the first, but with AI characters Crowds Paths are generated for multiple characters to avoid collisions Questions?