hi, this is my first post.
i'm programming a tiny game in webgl, and i would ask what is a better way to program animations:
actually i do a matrix transformation for every element of an object (a humanoid body for example),
i tryed to implement a bone system, where vertices are calculated from bone position, this is more cloth-like but too wavy.
so i'm thinking to do a very complex animation, and store precalculated vertices in a buffer and then ->
frame1 -> draw(0,100)
frame2 -> draw(100,100)
and so on
is this a good metod? what about performance? and if can this work, are there somebody who did that?
The number of frames necessary to make a jitter-free animation means you would be consuming a massive amount of RAM.
It is really not a good idea. Just use matrix multiplication or position-vector/scale-vector/rotation-quaternion interpolation with a matrix build out of those components at the end.
Storing keyframes for vertices was actually common practice not too long ago. The first 3 quakes used that method to great effect, I'm sure there are still games today that use it as well. He is correct though, it will use more ram. For a small game, it's a non-issue. Just remember to only store diffs and to make sure you have keyframes so you can easily jump to a different animation.