Motion Representation & forward Kinematics Jinxiang Chai.

26
Motion Representation & forward Kinematics Jinxiang Chai
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    243
  • download

    0

Transcript of Motion Representation & forward Kinematics Jinxiang Chai.

Page 1: Motion Representation & forward Kinematics Jinxiang Chai.

Motion Representation & forward Kinematics

Jinxiang Chai

Page 2: Motion Representation & forward Kinematics Jinxiang Chai.

Topics

• Representing charactersRepresenting characters

• Transformation hierarchiesTransformation hierarchies

• Skeleton file (.asf file)Skeleton file (.asf file)

• Motion data file (.amc file)Motion data file (.amc file)

Page 3: Motion Representation & forward Kinematics Jinxiang Chai.

Assumptions

Linear algebraLinear algebra

• matrix multiplication, linear transformationsmatrix multiplication, linear transformations

Page 4: Motion Representation & forward Kinematics Jinxiang Chai.

b da c

i

m

f

l

q

he

j k

pon

Px

Py

Pz

1

Transformation Matrix

Page 5: Motion Representation & forward Kinematics Jinxiang Chai.

01 0

1

1

1

00

0 0

000

Ty

Tz

Tx

Translation along x, y and z axis

Translation Matrix

Page 6: Motion Representation & forward Kinematics Jinxiang Chai.

We know how to rotate about the global axes

1 0 00 cos() -sin()0 sin() cos()

cos() -sin() 0sin() cos() 0 0 0 1

cos() 0 sin() 0 1 0-sin() 0 cos()

Rotate θ around x axis

Rotate θ around z axisRotate θ around y axis

Rotation matrices

Page 7: Motion Representation & forward Kinematics Jinxiang Chai.

Character Models are rich, complexCharacter Models are rich, complex

• hair, clothes (particle systems)hair, clothes (particle systems)

• muscles, skin (FFD’s muscles, skin (FFD’s etc.etc.))

Focus is rigid-body Degrees of Freedom (DOFs)Focus is rigid-body Degrees of Freedom (DOFs)

• joint anglesjoint angles

• what we can currently obtain from motion capture datawhat we can currently obtain from motion capture data

Character Representation

Page 8: Motion Representation & forward Kinematics Jinxiang Chai.

Simple Rigid Body Skeleton

Copyright © Squaresoft 1999

Who wins? You decide.Who wins? You decide.

vs.vs.

Page 9: Motion Representation & forward Kinematics Jinxiang Chai.

Human Motion Representation

How to represent right leg motion?

Page 10: Motion Representation & forward Kinematics Jinxiang Chai.

Representing a Skeleton

Model & connect each boneModel & connect each bone

• difficult to formulate joint limitsdifficult to formulate joint limits

• not very efficient either not very efficient either

– explicit constraints for jointsexplicit constraints for joints

– many wasted DOFsmany wasted DOFs

xh,yh,zh,h,h,h

xt,yt,zt,t,t,t

xc,yc,zc,c,c,c

xf,yf,zf,f,f,f

Page 11: Motion Representation & forward Kinematics Jinxiang Chai.

Efficient Skeleton: Hierarchy

Implicitize joint constraintsImplicitize joint constraints

• each bone relative to parenteach bone relative to parent

• easy to limit joint angleseasy to limit joint angles

• very efficientvery efficient

– # angles = # DOFs# angles = # DOFs

– no constraints to enforceno constraints to enforce

– leverages graphics libraries leverages graphics libraries and hardwareand hardware

xh,yh,zh,h,h,h

t,t,t

c

f,f

hips

r-upper leg

r-lower leg

r-foot

left-leg ...

Page 12: Motion Representation & forward Kinematics Jinxiang Chai.

Operations on Hierarchies

Specify posesSpecify poses

Draw the character in a given poseDraw the character in a given pose

Compute positions and orientations on bodyCompute positions and orientations on body

for example...

Page 13: Motion Representation & forward Kinematics Jinxiang Chai.

Computing a Sensor Position

Forward kinematicsForward kinematics

• uses vector-matrix multiplicationuses vector-matrix multiplication

• transformation matrix is composition of all joint transformation matrix is composition of all joint transforms between sensor/effector and roottransforms between sensor/effector and root

xh,yh,zh,h,h,h

t,t,t

c

f,f

vs

y

x

z

w =vsv( , )

ffq fTR( )cqTR( , , )

t t tq f sTR( , , ) ( , , )

h h h h h hx y z q f sT R

vsvs

Page 14: Motion Representation & forward Kinematics Jinxiang Chai.

Joints = Rotations

To specify a pose, we specify the joint-angle rotationsTo specify a pose, we specify the joint-angle rotations

Each joint can have up to three rotational DOFsEach joint can have up to three rotational DOFs

1 DOF: knee1 DOF: knee 2 DOF: wrist2 DOF: wrist 3 DOF: arm3 DOF: arm

Page 15: Motion Representation & forward Kinematics Jinxiang Chai.

Representing Motions

animation = Pose(time)animation = Pose(time)

See demo using maya!See demo using maya!

Page 16: Motion Representation & forward Kinematics Jinxiang Chai.

Motion Capture Data

Each sequence of human motion data contains Each sequence of human motion data contains two files:two files:

• Skeleton file (.asf): Skeleton file (.asf):

Specify the skeleton model of characterSpecify the skeleton model of character

• Motion data file (.amc): Motion data file (.amc):

Specify the joint angle values over the frame/timeSpecify the joint angle values over the frame/time

Page 17: Motion Representation & forward Kinematics Jinxiang Chai.

.ASF file

Specify character skeletonSpecify character skeleton

• Individual boneIndividual bone

• Bone hierarchyBone hierarchy

Page 18: Motion Representation & forward Kinematics Jinxiang Chai.

.ASF file: Bones

For each bone

begin id bone_id                  //Unique id for each bone name bone_name        //Unique name for each bone direction dX dY dZ    //Vector describing direction of the bone in world coor. system length 7.01722           //Length of the bone axis 0 0 20 XYZ         //Rotation of local coordinate system for                                    //this bone relative to the world coordinate                                    //system. In .AMC file the rotation angles                                     //for this bone for each time frame will be                                    //defined relative to this local coordinate                                     //system dof rx ry rz                //Degrees of freedom for this bone. limits (-160.0 20.0)             (-70.0 70.0)             (-60.0 70.0) end

Page 19: Motion Representation & forward Kinematics Jinxiang Chai.

. ASF file: Hierarchy

:hierarchy begin root lhipjoint rhipjoint lowerback lhipjoint lfemur lfemur ltibia ltibia lfoot lfoot ltoes rhipjoint rfemur rfemur rtibia rtibia rfoot rfoot rtoes lowerback upperback upperback thorax thorax lowerneck lclavicle rclavicle

lowerneck upperneck upperneck head lclavicle lhumerus lhumerus lradius lradius lwrist lwrist lhand lthumb lhand lfingers rclavicle rhumerus rhumerus rradius rradius rwrist rwrist rhand rthumb rhand rfingers end

Page 20: Motion Representation & forward Kinematics Jinxiang Chai.

. ASF file: Hierarchy

:hierarchy begin root lhipjoint rhipjoint lowerback

• Three bones connected to root

• Root is the parent node of lhipjoint, rhipjoint, and lowerback

root lhipjoint rhipjoint

lowerback

Page 21: Motion Representation & forward Kinematics Jinxiang Chai.

. ASF file: Hierarchy

rhips

rfemur

rtibia

r-foot

right-leg:hierarchy begin root lhipjoint rhipjoint lowerback lhipjoint lfemur lfemur ltibia ltibia lfoot lfoot ltoes rhipjoint rfemur rfemur rtibia rtibia rfoot rfoot rtoes lowerback upperback upperback thorax thorax lowerneck lclavicle rclavicle

lowerneck upperneck upperneck head lclavicle lhumerus lhumerus lradius lradius lwrist lwrist lhand lthumb lhand lfingers rclavicle rhumerus rhumerus rradius rradius rwrist rwrist rhand rthumb rhand rfingers end

Page 22: Motion Representation & forward Kinematics Jinxiang Chai.

Hierarchical Representation

Page 23: Motion Representation & forward Kinematics Jinxiang Chai.

.AMC file

i // frame numberroot -2.55317 16.3652 11.0758 -164.044 40.963 179.196 // root position and orientationlowerback -13.4812 3.58739 1.31326 // joint angles for lowerback jointupperback 2.71059 4.96065 -3.24804 // joint angles for thorax jointthorax 10.9583 2.59835 -3.13219lowerneck -13.4561 2.04484 3.87687upperneck 31.3081 7.2808 -9.21625head 13.2432 3.21452 -3.00079rclavicle -1.39845e-013 3.18055e-014rhumerus 13.7295 21.2853 -86.8555rradius 116.413rwrist -17.0142rhand -7.19777 10.0191rfingers 7.12502rthumb 18.6806 -19.1039

….

For each frame

Page 24: Motion Representation & forward Kinematics Jinxiang Chai.

Animation with .ASF and .AMC file

See demo!See demo!

Page 25: Motion Representation & forward Kinematics Jinxiang Chai.

• Representing charactersRepresenting characters

• Transformation hierarchiesTransformation hierarchies

• Skeleton file (.asf file)Skeleton file (.asf file)

• Motion data file (.amc fileMotion data file (.amc file

• Representing charactersRepresenting characters

• Transformation hierarchiesTransformation hierarchies

• Skeleton file (.asf file)Skeleton file (.asf file)

• Motion data file (.amc fileMotion data file (.amc file

Today’s topic

Page 26: Motion Representation & forward Kinematics Jinxiang Chai.

1) Create a 1) Create a handlehandle on body on body

• position or orientation position or orientation

2) Pull on the handle2) Pull on the handle

3) IK figures out how joint angles 3) IK figures out how joint angles should changeshould change

1) Create a 1) Create a handlehandle on body on body

• position or orientation position or orientation

2) Pull on the handle2) Pull on the handle

3) IK figures out how joint angles 3) IK figures out how joint angles should changeshould change

Next Lecture: Inverse Kinematics