animation advice
My 3D game that I'm working on supports 3D hierarchies, and I need it to support them in animation too. I'm thinking about using key-frame based animation, and I'm basically wondering:
Would it be better to store the rotation/translation of every key-frame in an array, have a set time that each keyframe takes, and then calculate the translation/rotation of the object based on how much time has gone by between each keyframe, or would it be better to have an array of the key-frame values, and then have an array with varying times in it for each keyframe (so if the object was going in a line, it would use less keyframes and have a different time), and then calculate the translation/rotation based on how much time has gone through on the current key-frame?
Sorry if the explanation was hard to follow
Thanks in advance
-wyrmmage
Would it be better to store the rotation/translation of every key-frame in an array, have a set time that each keyframe takes, and then calculate the translation/rotation of the object based on how much time has gone by between each keyframe, or would it be better to have an array of the key-frame values, and then have an array with varying times in it for each keyframe (so if the object was going in a line, it would use less keyframes and have a different time), and then calculate the translation/rotation based on how much time has gone through on the current key-frame?
Sorry if the explanation was hard to follow

Thanks in advance

-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Both seem viable. If you're comfortable constraining yourself to a constant keyframe interval, you might get a more uniform-looking animation; on the other hand, if you specify the interval for each keyframe, you might be able to save a significant number of keyframes throughout the animation.
Also, approach B is a superset of approach A, so you don't lose any flexibility if you go that route.
Had to read that several times before I saw any difference between the two.
Also, approach B is a superset of approach A, so you don't lose any flexibility if you go that route.
Had to read that several times before I saw any difference between the two.
Ok, Thanks for the advice
Something you said made the sparked a realization that made the decision pretty easy. Since my program is pretty much just advancing through the keyframes and not accounting for lost time if the keyframe max time is exceeded, then I would actually be getting rougher animation if I used more keyframes
Anyway, thanks again
-wyrmmage
Something you said made the sparked a realization that made the decision pretty easy. Since my program is pretty much just advancing through the keyframes and not accounting for lost time if the keyframe max time is exceeded, then I would actually be getting rougher animation if I used more keyframes
Anyway, thanks again
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com/forum/
wyrmmage Wrote:Since my program is pretty much just advancing through the keyframes and not accounting for lost time if the keyframe max time is exceeded, then I would actually be getting rougher animation if I used more keyframesSounds like something easily fixed...
Code:
while (timestep > keyframes[keyframeIndex].interval) {
timestep -= keyframes[keyframeIndex].interval;
keyframeIndex++;
keyframeIndex %= numberOfKeyframes;
}
