Posted By: boyax
bone animation - 05/21/09 09:08
Hi,
I got here some problem with bone animation in my model.
I have a model riding in a bicycle. So, turning left/right would also appear his shoulder bones and the bicyle turn left/right.
But I got stucked since it appears the shoulder bones just move/rotate a small angle or seems not moving when turning left/right..
Here's the code:
So, turning left/right I use the mode: ANM_ADD
Hope you can advise. Thanks
I got here some problem with bone animation in my model.
I have a model riding in a bicycle. So, turning left/right would also appear his shoulder bones and the bicyle turn left/right.
But I got stucked since it appears the shoulder bones just move/rotate a small angle or seems not moving when turning left/right..
Here's the code:
Code:
action movePlayer() { player = my; //I'm the player var dist_ahead; var anim_percent = 0; //vec_for_min(vFeet,my); // vFeet.z = distance from player origin to lowest vertex while (1) { dist_ahead = 5*(key_w-key_s)*time_step; c_move(my,vector(dist_ahead,0,0),nullvector,IGNORE_PASSABLE | GLIDE); // move the player // animate the player according to its moved distance if (dist_ahead != 0) // player is moving ahead { anim_percent += 1.3*dist_ahead; // 1.3 = walk cycle percentage per quant ent_animate(my,"SlowPedal",anim_percent,ANM_CYCLE); // play the "slow pedal" animation if(key_a) { // rotate the player using the [A] and [D] keys; play animation... my.pan += 1*(key_a-key_d)*time_step; ent_animate(my,"TurnLeft",anim_percent,ANM_ADD); } else if(key_d) { my.pan += 1*(key_a-key_d)*time_step; ent_animate(my,"TurnRight",anim_percent,ANM_ADD); } } isometric_camera(); wait(1); } }
So, turning left/right I use the mode: ANM_ADD
Hope you can advise. Thanks