290 likes | 500 Views
Design and Implementation of Motion Synthesis System Based on Support Phase. Quan Yu. Outline. Background and Related Work My Work System Design and Implementation Design Idea and System Framework Torso Coordinate and BVH File Support Phase Detecting Dynamic Time Warping Motion Blending
E N D
Design and Implementation of Motion Synthesis System Based on Support Phase Quan Yu
Outline • Background and Related Work • My Work • System Design and Implementation • Design Idea and System Framework • Torso Coordinate and BVHFile • Support Phase Detecting • Dynamic Time Warping • Motion Blending • Skinning • Result • Conclusion and Future Work
Background • Motion Capture System • Two Defects • Only available data that can be used. • The data can only be applied to the character who shares the same skeleton structure with the actor. • Solution: motion synthesis and retargeting motion transition
Related Work Support Phase: Make a transition between two support phases Motion Graph: Make a transition between two frames with the most similar postures. computation consuming can be smoother
My Work • Implement an interactive motion synthesis system based on support phase detecting, dynamic time warping and motion blending • Skinning Mesh Animation
System Design and Implementation • Design Idea and System Framework • Torso Coordinate and BVHFile • Support Phase Detecting • Dynamic Time Warping • Motion Blending • Skinning
Design Idea • Support Phases Detecting: • Find the idealist pair of support phases • Synchronize the motion and narrow the searching scope • Dynamic Time Warping • Find the start frame and end frame for blending • The smaller distance, the smoother transition • Motion Blending • Generate the transition with linear or spherical linear interpolation
Design Idea(Cont.) a general motion transition a transition based on support phases
System Framework System Flowchart
Torso Coordinate and BVH File • Torso Coordinate:a tree structure • BVH File:skeleton structure and motion data HIERACHY ROOT hip { OFFSET 0.00 0.00 0.00 CHANNELS 6 Xpositon Ypos. Zpos. Xrotation Zrot. Yrot. JOINT chest { OFFSET 0.000000 5.018153 -1.882228 CHANNELS Xrotation Zrotation Yrotation …… End Site { OFFSET 0.000000 -6.699570 0.000000 } } } MOTION Frames: 100 Frame Time: 0.033333 0.000000 42.014908 0.240040 14.929800 0.146550 ……
Torso Coordinate and BVH File(Cont.) • Transformation Matrix • Compute joints positions in the world coordinate E.g. : transformation matrix for left ankle The position of left ankle:
Torso Coordinate and BVH File(Cont.) • Recursive Program by utilizing matrix stack of OpenGL void calJointsPositionAtFrame(Joint* joint,int frame_no) { GLfloat M[16]; glPushMatrix(); glTranslatef(x_offset,y_offset,z_offset); glRotatef(radX, 1.0f, 0.0f, 0.0f ); glRotatef(radY, 0.0f, 1.0f, 0.0f ); glRotatef(radZ, 0.0f, 0.0f, 1.0f ); glGetFloatv(GL_MODELVIEW_MATRIX,M); Vector3 pos=Vector3(M[12],M[13],M[14]); mapJointsPositionAtFrame[frame_no]->push_back(pos); for (int i=0; i<joint->numOfChildren(); i++ ) calJointsPositionAtFrame( joint->getChild(i), frame_no ); // recursion glPopMatrix(); }
Support Phase Detecting • Find the idealist pair of support phases • Support Phase • The constrain between the feet and the ground • Four Categories • no support(NS), right leg support(RS), left leg support(LS), double leg support(DS) • Classification criteria • The height and velocity of feet “ > ” :larger than the threshold “ < ” :smaller than the threshold ” * ” :unrelated
Support Phase Detecting(Cont.) • Choose the candidate pairs Rules: e.g. “ O ” : possible “ X “ : impossible
Support Phase Detecting(Cont.) • Choose the idealist pair of support phases • Selection Criteria • The lengths of A_sp and B_sp are nearly the same. • Both the lengths of A_sp and B_sp are close to the ideal length • Final criterion • Choose the pair with minimal w.
Dynamic Time Warping • Find the start frame for A_sp and end frame for B_sp • Feature Vector • Position, velocity and acceleration of Joints in WCS. • Align the root joint of frame B_sp_j with that of frame A_sp_i. Alignment Matrix: Velocity: Acceleration:
Dynamic Time Warping(Cont.) • Frame distance • Measure the similarity of a pair of frames(postures) • Choose the pair with minimal frame distance position distance: velocity distance: acceleration distance: frame distance:
Dynamic Time Warping(Cont.) • Criteria for blending length (1) Use the ideal length (threshold) if possible; (2) Or else, use the length as long as possible; (3) If the length is smaller than minimal threshold, use minimal length, and adjust the start fame and the end frame.
Motion Blending • Motion Alignment • Align the position of the root joint of B_sp_i with that of A_sp_i • Align the velocity direction of the root joint of B_sp_i with that of A_sp_i
Motion Blending (Cont.) • Interpolation • root position: linear interpolation • root orientation: linear interpolation with small angle • other channels: spherical linear interpolation Also and
Skinning • Linear blend skinning • Skin: obj file • Weight : xml file • Binding: 3dmax skinmodifier • The position of a vertex in WCS vertex position in WCS at binding pose Inverse transformation matrix of bone i at the binding pose transformation matrix of bone i at a frame weight of vertex related to bone i the number of bones influencing this vertex vertex position in WCS at a frame
Result • User interface • VC2005、OpenGL and Qt
Result(Cont.) • parameter dialog
Result(Cont.) • Support phase detecting result • Adjust the threshold manually if there is a need
Result(Cont.) a transition from walking to running
Result (Cont.) a transition from walking to jumping
Result (Cont.) • skinning result
Conclusion and Future Work • Design and implement a motion synthesis system based on support phases, dynamic time warping and motion blending. • Future Work • motion path synthesis • improve skinning algorithm and result