With the difficulty in implementing space-time constraints, it may be worthwhile to investigate cheaper methods for motion editing that may yield results that could be good enough. One such approach is motion displacement mapping, which can produce modified motion that preserves the high-frequency behavior of the original motion [1][2]. For this project, the displacement map will be generated interactively. On top of an underlying motion (either a series of motion-capture frames or a "default" stationary motion curve), the user manually edits joint positions at keyframes and an inverse kinematic solver computes the corresponding joint angles. The displacement maps will be created from the keyframe points by various interpolations: by spherical interpolation of quaternions, by some cubic interpolation of euler angles, and possibly by other interpolation techniques. The quality of the different techniques can then be visually examined and compared.
Interpolation in the root position displacement map is achieved with a cubic Hermite-style spline using the slope between neighboring points as the tangent (first derivative). Specifically, for the four points p1, p2, p3, p4, interpolating a point between p2 and p3 is effected by solving the following equations:
y2 = ax23 + bx22 + cx2 + dFor the joint angles, three methods of interpolation are supported:
y3 = ax33 + bx32 + cx3 + d
y2' = (y3 - y1) / (x3 - x1) = 3ax22 + 2bx2 + c
y3' = (y4 - y2) / (x4 - x2) = 3ax32 + 2bx3 + c
One of the motivations for this project was to see if linear interpolation of quaternions can achieve better results than interpolation of Euler angles. The observation from editing several motion capture files is that to maintain the significance of the high-frequency motion capture data, only small changes to joint angles should be made; but when joint angles are small, there is practically no difference between interpolation of Euler angles and of quaternions. It is unclear whether linear or cubic interpolation is "better", they behave differently, and can each be useful in different circumstances.
Usage: MotionEditing <BVH-file>
key | command |
p | Perspective View |
x | X-projection Views |
y | Y-projection Views |
z | Z-projection Views |
i | Zoom in |
o | Zoom out |
h | Pan left |
j | Pan up |
k | Pan down |
l | Pan right |
a | Animate (start/stop animation) |
s | Slow motion 1 |
f | Forward one frame |
b | Backward one frame |
u | Change up direction |
m | Toggle wireframe mode |
t | Trace end effector positions |
q | Quaternion/Euler mode |
c | Cubic/Linear interpolation mode |
s | Set interpolation key 2 |
d | Delete interpolation keys 2 |
g | Center camera on root node |
n | Show "normal" skeleton (Frankenstein pose) |
r | Reset all states in current window |
A | Add displacement map points for selected joints in current frame |
D | Delete displacement map points for selected joints in current frame |
M | Merge displacement map data onto motion capture data |
P | Clear motion-capture position data |
Q | Clear position displacement map |
R | Clear motion-capture rotation data |
S | Clear rotation displacement maps |
O | Write motion to output.bvh file |
I | Print displacement map points for selected joints in current frame to stdout |
w | New window 3 |
v | New view 3 |
X | Close window/quit |
A number of actions are performed only on selected nodes. Most importantly, only edited nodes and joints can be edited. Simply click-drag on a selected node to edit its position.
References:
[1] A.Burderlin, L.Williams. "Motion Signal Processing". SIGGRAPH '95.
[2] A.Witkin, Z.Popovic. "Motion Warping". SIGGRAPH '95.