Motion Path Editting--Hsing–Yu Fu、Pei–Ching Li
Two extra shots
Abstract

Motion path editing

Authors
Hsing–Yu Fu , Pei–Ching Li
Abstract

Motion path editing

Technical introduction

Hsing–Yu Fu     M9915012

Pei–Ching Li          B9630154

 

Using CEGUI to establish the user interface

 

  1. About bvh parser

n   The basic bvh file must be the under format and follow the number sequence

  HIERARCHY

‚  ROOT  <name>

ƒ  {. . . . .}

„  MOTION

…  Frames:  <value>

†  Frame Time:  <value>

‡  <frames below>

n   The detailed robustness is listed below

u  First line should be ‘HIERARCHY’ and second line should be ‘ROOT’ followed a name

u  { } should be pair and in correct order; ‘{‘ and ‘}’ should be in a single line without any other characters       ex.   { { } { } } is right               } { { } } } { is wrong

u  The channels in ‘ROOT’ must be

CHANNELS  6  <value>  <value>  <value>  <value>  <value>  <value>

u  The structure of ‘JOINT’ and ‘End Site’ are listed below; ‘OFFSET’ and ‘CHANNELS’ could be swapped. Besides, the italics is optional

JOINT  <name>

{

OFFSET   <value>  <value>  <value>

CHANNELS  3  <value>  <value>  <value>

JOINT  < name >  {. . .}

End Site  {. . .}

}

End Site

{

OFFSET   <value>  <value>  <value>

}

u  The parser deals with only one ‘End Site’ in a last order joint of hierarchical JOINT; it also understands the keyword, ‘End site’

u  ‘CHANNELS’ shouldn’t be put in the ‘End Site’

u  There must have ‘OFFSET’ in each { }

u  The parser can’t read other keywords except HIERARCHY, ROOT, OFFSET, CHANNELS, JOINT, End Site, End site, MOTION, Frames, Frame Time, Frame time

u  The total lines of <frames below> shouldn’t be larger than ‘Frames’ value

u  Each line of <frames below> should have same numbers with a skeleton’s channels

u  There are some error messages will be printed out in the ‘Motion Menu’ when the parser finds the problems described above

  1. Basically functionality and CEGUI’s button

n   view : world and person

n   load and save

u  “hide” at the beginning

u  designate the route when load/save is “show”

u  disable “OK” button of load menu when no bvh files exist in the designated folder

u  enable “OK” button of save menu when entering the file name and pressing ‘Enter’ or ‘Tab’

Π after loading

Ä  calculating the length of the person’s leg to avoid it doesn’t stand on the ground (too height/low)

Ä  the person will run on the blue line and you can save this motion originally

Π you can save and reload the saved file; however, there are some problems about rotation in edit path. Because we use Quaternion to deal with the joint’s rotation. So, we should compute the Euler angle from the quaternion.

n   edit control point

u  input number of control point shouldn’t less than 4, and so does “Delete CP” function

u  enable “Add CP”, “Delete CP”, “RunPath”, and “Pause” buttons after correct input

Π Compute path:Compute the path from all the position in each frame. Using the Cubic Spline interpolation Bi(t) = b i 0*t3 + b i 1*t2 +b i 2*t +b i 3. When we input the control points number we can get the path’s number. ( Ex: Input CP = 5, We got Path’s number = 5 - 3 = 2.) We can cut the full path into the path’s number. There are many details in the cut technology. Finally, we got a huge matrix (It’s not a square matrix). The form is like to solve Ax = b. A is a matrix generated by the bi0~bi3 We can solve it using two ways : (1) SVD  (2) x = (AtA)-1Atb. After that we got all the control points. We have to use the Bi(t) again. Meanwhile, we do the arclength. For “Arclength” , I hope to get the good distance between points. We use B’i(t) = 3*b i 0*t2 + 2*b i 1*t +b i 2 . Because there have a function to compute the parameter t.
                     B i (t+Δt) ≈ B(t) +Δt * B’i(t’)
it implied to

B i (t+Δt) - B(t) ≈ Δt * B’i(t’)

||B i (t+Δt) - B(t)||  = ||Δt * B’i(t’)||

Δt = ||B i (t+Δt) - B(t)|| / ||B’i(t’)||

                        After we finished above, we continue to compute the tangent vector for each point. We can use it to control the motion editing.

Π only opening the edit mode with correct input, the person could run on the editing path and you can save it then

n   Quit/Esc : terminate the OGRE

n   Lighting (spot), shadow, ground, sky dome

n   The person has bones instead of line

 

  1. Contribution/attribution

n   We really appreciate Masaki OSHITA, Corey, Alex, Tom for downloading the codes used in our programs. The detailed application is below :

u  BVH.h and BVH.cpp : we use these two files mostly written by Masaki OSHITA as our bvh parser and modify some functions to robust the parser. However, the tab() and three write() functions under the files are constructed by Corey, Alex, and Tom who studied in University of Wisconsin at Madison, 2009. We use the four functions to save the bvh file.