Modifying bone rotations.

Posted By: colekindred

Modifying bone rotations. - 08/11/04 02:16

K one more question about A6 before I commite my project too it. This is simular to the IK question I asked before but diffrent LOL. does the engine allow modification of bone rotations in relation to thier keyframed rotations in real time.

For example. Lets say I have a character animated so he runs with keyframes. can I make lets say the spine twist 10 deg to the left in relation to its keyframe.

so if keyframe 1 set the spine to -5 deg, keyframe 2 set the spine to -10 deg, and keyframe 3 set the spine to +5 deg, could I add -10 to the vaules so keyframe 1 would = -15 deg, keyframe 2 = -20, and keyframe 3 = -5
?
Posted By: qwerty823

Re: Modifying bone rotations. - 08/11/04 04:47

While I'm no "bones" expert, it looks what you are trying to do should work by doing a:

ent_animate(entity,frame,pct,0); // Set the frame to the pct.
ent_bonerotate(entity,"spine",vector(10,0,0)); // To twist (pan) the spine 10 deg

Although base on what I think you are talking about, you want to have a seperate animation from upper body (like aiming a gun), and one for lower body (like running), and blend the two.

If you make an upper body one where at 0 percent its aimming left, and 50% its middle, and 100% its right. And a lower body which cycles the run. You should be able do to something like this:

ent_animate(entity,"run",run_pct,ANM_CYCLE);
ent_animate(entity,"aim",aim_pct,ANM_ADD);

And that should do the same thing (without having to do the bone math yourself).
Posted By: colekindred

Re: Modifying bone rotations. - 08/11/04 05:43

Thanks for the reply. I know I can seperate the mesh into two but thats sort of behind in todays market. As long as I can modify the bones rotation while still having the keyframes effect it i'm happy (I don't mind doing the math). That way I can achive a huge amount of animations that will blend seamlessly.

Just to be clear if I add 10deg to a bone does it add it to its current rotation that is set by the keyframes or would the keyframes stop effecting the bone all together?
Posted By: qwerty823

Re: Modifying bone rotations. - 08/11/04 06:18

Quote:

Thanks for the reply. I know I can seperate the mesh into two but thats sort of behind in todays market.




One mesh, but two seperate animations. One animation that moves the upper body bones (leaves the leg bones alone), and another that moves the leg bones. Then you set each one independently.

Quote:

As long as I can modify the bones rotation while still having the keyframes effect it i'm happy (I don't mind doing the math). That way I can achive a huge amount of animations that will blend seamlessly.




Yes, the first way I described it should work that way.

Quote:

Just to be clear if I add 10deg to a bone does it add it to its current rotation that is set by the keyframes or would the keyframes stop effecting the bone all together?




Yes, the manual states that all bone updates are relative to their current positions, and if you need to do absoulte move/scale/rotate, then you need to reset the bones, and apply then.

There are a few bones demos out there to show you how it works. One, if I remember correctly, had a person walking, and you could move the head around with the mouse. Not sure if it used angles or seperate keyframes though.
Posted By: colekindred

Re: Modifying bone rotations. - 08/12/04 02:52

thx alot for clearing that up. I'm glade to here it. I'll be starting the project in a few days
Posted By: giorgi3

Re: Modifying bone rotations. - 08/12/04 12:39

Check out chapters 22-23 in the new C-Script Tutorials (also available on the Gamestudio download page).

George did a very good job of explaining how to manipulate bones with A6 Scripting language. I think you'll like it.
© 2023 lite-C Forums