Original Post
Hi, I've been working on my graphics engine for a bit now but I came across this problem which I didn't know the fastest way to solve and that is animations. I thought of a few ways to do this but none seemed flawless. I want to ask if other people have experience with how they are done in other engines or suggest alternatives which I haven't come up with off the top of my head. Let's take a human skeleton for example. 1) Separate the skeleton in code _______________________________ By this I mean handle all the bones in the body as separate meshes and transform them directly in the code. I see this is done in some DS games, where when you change a specific piece of armor, that piece of the mesh changes. This requires fine tuning in the code. But the way I see it, this will be efficiency for humanoid models, but not for others. The way I have thought of doing this is just to animate a set of bones and export them to Collada DAEs and essentially just attach different meshes to each joint. This however poses the big problem of very noticeable intersecting meshes. 2) Deform the mesh according to the skeleton _____________________________________________ I've programmed this before in C++ using Collada exports. Everything worked fine except it was slow calculating the inverse matrices for each joint and applying it to every vertex. Doing this in real time was time consuming. One could argue that I can calculate this only when a move has occurred, but this doesn't work too well with cases where a model is just standing still but is moving up and down doing some basic stationary actions such as just basic breathing. 3) Separating Every Frame of the animation into separate files _____________________________________________________________ The Big O of storage space of this method will be off the charts. To save on space, I'm assuming vertex texture coords don't change as the mesh moves. But each vertex position and their normals will change from frame to frame. However just saving 1/3 per frame still implies a huge amount of data that needs to be stored. I don't like this method and don't think that is how it's done. I know there must be a better way other than my best idea so far which is method 1. Can some people in the community give me some ideas or links? PS: The reason I ported using Collada is that OBJ files lack Joint information. Thanks. I think many others have the same questions that I do.