ジョイントと、同時に作られるボーンはスケルトンにおいて関節と骨を表すものである。
スケルトンを作るためには、まずジョイントによって骨組を構成してゆく。
ジョイントは親のジョイントを指定することによって枝分かれさせることができる。
最初の簡単な例として、3つのジョイントと2つのボーンで作られたジョイント・チェーンを作ってみる。
joint;
joint -p 5 0 0;
joint -p 5 5 0;
次に人間の骨組を表すジョイントを作ってみよう。
首のジョイントを親にして両手を作り、胴体のジョイントを親にして両足を作る。
joint -p 0 10 0 -n headJoint;
joint -p 0 8 0 -n neckJoint;
joint -p 0 0 0 -n bodyJoint;
joint -p 5 6 0 -n leftArmJoint1 neckJoint;
joint -p 10 8 0 -n leftArmJoint2 leftArmJoint1;
joint -p -5 6 0 -n rightArmJoint1 neckJoint;
joint -p -10 8 0 -n rightArmJoint2 rightArmJoint1;
joint -p 3 -5 0 -n leftLegJoint1 bodyJoint;
joint -p 5 -10 0 -n leftLegJoint2 leftLegJoint1;
joint -p -3 -5 0 -n rightLegJoint1 bodyJoint;
joint -p -5 -10 0 -n rightLegJoint2 rightLegJoint1;
上で作ったジョイント(骨組)をもとにしてポーズをつけたり、アニメーションをするためにはインバース・キネマティクスを使用する。
ikHandleというコマンドによって最初のジョイントと最期のジョイントをむすんだインバース・キネマティクスがつけることができる。
3つのジョイントと2つのボーンで作られたジョイント・チェーンに ikHandleによってインバース・キネマティクスをつける。
joint;
joint -p 5 0 0;
joint -p 5 5 0;
ikHandle;
人間の骨組を表すジョイントにインバース・キネマティクスをつける。
joint -p 0 10 0 -n headJoint;
joint -p 0 8 0 -n neckJoint;
joint -p 2 7 0 -n sholderJoint1 neckJoint;
joint -p -2 7 0 -n sholderJoint2 neckJoint;
joint -p 0 0 0 -n bodyJoint1 neckJoint;
joint -p 1 -1 0 -n bodyJoint2 bodyJoint1;
joint -p -1 -1 0 -n bodyJoint3 bodyJoint1;
joint -p 5 6 0 -n leftArmJoint1 sholderJoint1;
joint -p 10 8 0 -n leftArmJoint2 leftArmJoint1;
joint -p -5 6 0 -n rightArmJoint1 sholderJoint2;
joint -p -10 8 0 -n rightArmJoint2 rightArmJoint1;
joint -p 3 -5 0 -n leftLegJoint1 bodyJoint2;
joint -p 5 -10 0 -n leftLegJoint2 leftLegJoint1;
joint -p -3 -5 0 -n rightLegJoint1 bodyJoint3;
joint -p -5 -10 0 -n rightLegJoint2 rightLegJoint1;
ikHandle -startJoint sholderJoint1 -endEffector leftArmJoint2 ;
ikHandle -startJoint sholderJoint2 -endEffector rightArmJoint2 ;
ikHandle -startJoint bodyJoint2 -endEffector leftLegJoint2 ;
ikHandle -startJoint bodyJoint3 -endEffector rightLegJoint2 ;