character animation questions
I'm doing some smooth skinning for character animation and I'm running into a few problems, that hopefully other people have found good solutions for. What I'm doing so far, is modelling and animating characters so that animations like walking, are done in the art package fixed to the root joint node. So they don't actually move, as if they are walking on a treadmill. Then in-game, I translate and orient them in the world. The problem I'm running into is matching the translation speed to the percieved speed of the animation. If I translate to quickly, the character looks like they are sliding across the ground. Too slowly, and it looks like they're walking on a treadmill. Right now, I just "eyeball" it, to get something that looks reasonable. Is there a robust way to figure out the translational speed? The only solution I can think of is to use the same units of measurement in the animation program as in the game (not really a problem) and count the number of units a foot moves from the time it first touches the ground, till the time it lifts off. If I translate the character in-game at the same speed, the forward translation of the foot, should "cancel out" the animation of the foot backwards with the end result being the feet of the character looking like they are actually touching the ground. This problem must have been encountered before, so I apologize if this has already been answered but I'm not really sure what to search terms to use exactly. (that and the forum search seems like its been down forever)
Well, I can't answer your question, except to say that your idea of measuring how many distance-units the foot moves and translate accordingly sounds good, but I just thought I'd direct you to our search workaround in case you need to look anything up before the proper search is up. Also, you might have better luck with this particular question in Visual Arts, although I'm sure someone will be able to give you good suggestions here.
- Jason Astle-Adams
If you know how long it takes for the forward foot to go back, and you know the distance the foot travels in that time, it shouldn't be too hard to get a reasonably close velocity.
You could even compute it programmatically, if you know the foot joints in your program. You'd want to do this in a preprocess, or at least load, step:
For each frame of the animation, record the distance between the feet. The two maximums of this should be the maximum distances. Take either of these distances or the average, minimum, maximum, or something (they should be pretty similar so it won't matter much), and divide it by the time between the two frames in which the maximums occur. This should give you a pretty good velocity to move the character with.
...at least I think that will work. The tricky part is you want relative maximums, which may not be the two biggest values if left foot forward has two frames with the feet futher apart than right foot forward's max, or vice versa.
You could even compute it programmatically, if you know the foot joints in your program. You'd want to do this in a preprocess, or at least load, step:
For each frame of the animation, record the distance between the feet. The two maximums of this should be the maximum distances. Take either of these distances or the average, minimum, maximum, or something (they should be pretty similar so it won't matter much), and divide it by the time between the two frames in which the maximums occur. This should give you a pretty good velocity to move the character with.
...at least I think that will work. The tricky part is you want relative maximums, which may not be the two biggest values if left foot forward has two frames with the feet futher apart than right foot forward's max, or vice versa.
Thanks for the link Kazgoroth, it will definetly come in handy.
Kibble, I thought an easy way around the picking the max, min, avg of the distances for the two feet would be just to have two walk speeds, one for each foot, if the walk cycle isn't symetric. Thx for the input
Yeah that will work fine. Though if you are going to have weird walk animations (like limping or something, thats the only non-symmetric walk I can think of), you might just want to check which foot is lower, see how far its traveled since the last frame, and simply use that distance to translate the character. That might be too jerky though. Maybe smooth it over the last few frames worth of data.
Good ideas, thanks guys. Since I'm interpolating between closely spaced keyframes just translating by the distance the "grounded" foot moved from the last frame should be pretty smooth.
I'm doing a 3D fighting game so I'm anticipating alot of martial arts movements that will be asymmetric WRT the legs.
thx again!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement