340 likes | 409 Views
Moving rules for 3D dog. Skeleton structure. “Leg up!” rules. LEFT_FRONT_LEG_UP ( HEIGHT ) LEFT_BACK_LEG_UP ( HEIGHT ) RIGHT_FRONT_LEG_UP ( HEIGHT ) RIGHT_BACK_LEG_UP ( HEIGHT ). Skeleton structure – front legs. Skeleton structure – back legs. LEFT_FRONT_LEG_UP – simple rule.
E N D
“Leg up!” rules • LEFT_FRONT_LEG_UP ( HEIGHT ) • LEFT_BACK_LEG_UP ( HEIGHT ) • RIGHT_FRONT_LEG_UP ( HEIGHT ) • RIGHT_BACK_LEG_UP ( HEIGHT )
LEFT_FRONT_LEG_UP – simple rule LEFT_FRONT_LEG_UP ( HEIGHT ) { MOVE LF_Ankle on OZ_AXIS ( - HEIGHT/4 ); MOVE LF_Ankle on OY_AXIS ( HEIGHT ); ROTATE LF_Ankle on OZ_AXIS ( - HEIGHT*0.9); }
RIGHT_FRONT_LEG_UP – simple rule RIGHT_FRONT_LEG_UP ( HEIGHT ) { MOVE RF_Ankle on OZ_AXIS ( - HEIGHT/4 ); MOVE RF_Ankle on OY_AXIS ( HEIGHT ); ROTATE RF_Ankle on OZ_AXIS ( - HEIGHT*0.9); }
LEFT_BACK_LEG_UP – simple rule LEFT_BACK_LEG_UP ( HEIGHT ) { MOVE LB_Ankle on OZ_AXIS ( - HEIGHT/4 ); MOVE LB_Ankle on OY_AXIS ( HEIGHT ); }
RIGHT_BACK_LEG_UP – simple rule RIGHT_BACK_LEG_UP ( HEIGHT ) { MOVE RB_Ankle on OZ_AXIS ( - HEIGHT/4 ); MOVE RB_Ankle on OY_AXIS ( HEIGHT ); }
“Move leg” rules • MOVE_LEFT_FRONT_LEG ( ANGLE ) • MOVE_RIGHT_FRONT_LEG (ANGLE ) • MOVE_LEFT_BACK_LEG ( ANGLE ) • MOVE_RIGHT_BACK_LEG ( ANGLE )
MOVE_LEFT_FRONT_LEG- simple rule MOVE_LEFT_FRONT_LEG ( ANGLE ) { ROTATE LF_Base on OZ_AXIS ( ANGLE ); }
MOVE_RIGHT_FRONT_LEG- simple rule MOVE_RIGHT_FRONT_LEG ( ANGLE ) { ROTATE RF_Base on OZ_AXIS ( ANGLE ); }
MOVE_LEFT_BACK_LEG- simple rule MOVE_LEFT_BACK_LEG ( ANGLE ) { ROTATE LB_Base on OZ_AXIS ( ANGLE ); }
MOVE_RIGHT_BACK_LEG- simple rule MOVE_RIGHT_BACK_LEG ( ANGLE ) { ROTATE RB_Base on OZ_AXIS ( ANGLE ); }
“Back bend” rules • BACK_BEND_DOWN ( ANGLE) • BACK_BEND_LEFT (ANGLE) • BACK_BEND_RIGHT (ANGLE)
BACK_BEND_DOWN – simple rule BACK_BEND_DOWN ( ANGLE ) { ROTATE Spine_F on OZ_AXIS ( - ANGLE ); }
BACK_BEND_LEFT – simple rule BACK_BEND_LEFT ( ANGLE ) { ROTATE Spine_F on OY_AXIS ( ANGLE/2 ); ROTATE Spine_B on OY_AXIS ( ANGLE/2 ); }
BACK_BEND_RIGHT – simple rule BACK_BEND_RIGHT ( ANGLE ) { ROTATE Spine_F on OY_AXIS ( - ANGLE/2 ); ROTATE Spine_B on OY_AXIS ( - ANGLE/2 ); }
“Move head” rules • MOVE_HEAD_UP ( ANGLE ) • MOVE_HEAD_DOWN ( ANGLE )
MOVE_HEAD_UP- simple rule MOVE_HEAD_UP ( ANGLE ) { ROTATE Shoulder on OZ_AXIS ( ANGLE*0.6 ); ROTATE Neck on OZ_AXIS ( ANGLE*0.4 ); }
MOVE_HEAD_DOWN- simple rule MOVE_HEAD_DOWN ( ANGLE ) { ROTATE Shoulder on OZ_AXIS ( - ANGLE*0.6 ); ROTATE Neck on OZ_AXIS ( - ANGLE*0.4 ); }
“Move tail” rules • MOVE_TAIL ( ANGLE ); • SWING_TAIL ( ANGLE, SWINGS );
MOVE_TAIL ( ANGLE ) – simple rule MOVE_TAIL ( ANGLE ) { ROTATE Tail_Base on OY_AXIS ( ANGLE ); ROTATE Tail_Middle on OY_AXIS ( ANGLE *1.5 ); }
SWING_TAIL ( SWINGS )- composed rule SWING_TAIL ( ANGLE, SWINGS ) { FOR i=1 TO i=SWINGS DO { MOVE_TAIL ( ANGLE ); MOVE_TAIL ( - ANGLE ); MOVE_TAIL ( - ANGLE ); MOVE_TAIL ( ANGLE ); } }
Moving rules • WALK ( BEND_HEIGHT, MOVE_ANGLE, STEPS) • SIT ( ANGLE ) • LAY_DOWN ( BEND_HEIGHT ) • GIVE_HAND ( ANGLE, BEND_HEIGHT )
WALK (1)- composed rule WALK (BEND_HEIGHT, MOVE ANGLE, STEPS) { int Step=0; DO { MOVE_LEFT_FRONT_LEG (MOVE_ANGLE); MOVE_RIGHT_BACK_LEG (MOVE_ANGLE); RIGHT_FRONT_LEG_UP (BEND_HEIGHT); MOVE_RIGHT_FRONT_LEG (MOVE_ANGLE); RIGHT_FRONT_LEG_UP (- BEND_HEIGHT); LEFT_BACK_LEG_UP (BEND_HEIGHT); MOVE_RIGHT_FRONT_LEG (MOVE_ANGLE); LEFT_BACK_LEG_UP (- BEND_HEIGHT);
WALK (2)- composed rule MOVE_RIGHT_FRONT_LEG (MOVE_ANGLE); MOVE_LEFT_BACK_LEG (MOVE_ANGLE); LEFT_FRONT_LEG_UP (BEND_HEIGHT); MOVE_LEFT_FRONT_LEG (MOVE_ANGLE); LEFT_FRONT_LEG_UP (- BEND_HEIGHT); RIGHT_BACK_LEG_UP (BEND_HEIGHT); MOVE_RIGHT_BACK_LEG (MOVE_ANGLE); RIGHT_BACK_LEG_UP (- BEND_HEIGHT); SWING_TAIL ( MOVE_ANGLE ); Step:=Step+1; } WHILE (Step<STEPS); }
SIT- composed rule SIT ( ANGLE ) { MOVE_LEFT_BACK_LEG ( ANGLE ); MOVE_RIGHT_BACK_LEG ( ANGLE ); ROTATE Parent ON OZ_AXIS ( ANGLE ); MOVE_LEFT_FRONT_LEG (ANGLE ); MOVE_RIGHT_FRONT_LEG ( ANGLE ); }
LAY_DOWN- composed rule LAY_DOWN ( BEND_HEIGHT) { LEFT_FRONT_LEG_UP ( BEND_HEIGHT ); RIGHT_FRONT_LEG_UP ( BEND_HEIGHT ); LEFT_BACK_LEG_UP ( BEND_HEIGHT ); RIGHT_BACK_LEG_UP ( BEND_HEIGHT ); MOVE Parent on OY_AXIS ( BEND_HEIGHT ); }
GIVE_HAND- composed rule GIVE_HAND ( ANGLE, BEND_HEIGHT) { SIT ( ANGLE ); LEFT_FRONT_LEG_UP ( BEND_HEIGHT); }
Under re-construction rules • JUMP • RUN • PLAY_DEAD • CHASE_TAIL