Jump to content
  • Advertisement
Sign in to follow this  
B_old

(Skeletal) Animation: Good way to store keyframes for different nodes?

This topic is 3348 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to build a simple skeleton animation system. Rendering the "skinned vertices" is ok. Now about the actual animation. I'm using Assimp to read in model/animation-data. For one animationsequence every node can have a different amount of keyframes. Now I wonder, if that is how animations usually are stored? I mean, couldn't I find the interesting keyframe faster, if I knew how many there will be, instead of treating every node separately. That would mean, that I look for the node with the most keyframes and add keyframes to the nodes that have fewer. I hope I could get my idea across and wonder how people are usually solving this.

Share this post


Link to post
Share on other sites
Advertisement
I'm going to refer to the bones being animated as "channels".

Lets assume you have N channels each capable of storing some keyframe data describing their value at time t, where t is in a range from min keyframe time to max keyframe time and that min/max time range can vary per channel.

It seems like the question you are asking is whether you should find the channel with largest min/max time range and then pad all the other channels so they are equally wide (in terms of time) by creating dummy keyframes for them.

That might give your interpolation algorithm an easier time looking up the previous keyframe matrix and the current keyframe matrix, since each channel would have the same array size and the same indices could be used across all channels, but I doubt you want to waste the additional memory required to pad all your channels to the largest channel's size.

Consider an example with three channels animating. The first two channels require 5 rotations during the course of time 0.0f to 1.0f and the other channel requires 30 rotations during the same course of time (0.0f to 1.0f)

Are you proposing to pad channels 1 and 2 so they have 30 rotations and their last 25 rotations basically are no-ops?

Share this post


Link to post
Share on other sites
You described what I was planning very well. Thanks for the answer. That was indeed my idea.
Maybe you are right and it is indeed stupid to waste the memory.

My new idea is, to group channels with the same amount of keyframes together, so that I can find common indices.

How would you do it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!