Suppose I am making my own C++ 3D engine; I can already load a 3D model using assimp, display it with phong lighting, and I now want to animate it.

I'd like features in my engine to, say, load a run animation with assimp, and apply it to my human character, preferably on the GPU side. Which techniques do I need to learn to develop this?

This is a "grocery list" kind of question, where I don't necessarily need a step-by-step explanation, but more of an overview of the techniques involved to know what I need to research. (stuff like "read this OpenGL tutorial" or "learn how X works")

  • $\begingroup$ I just stumbled on glTF which is pretty wide and instructive; I might add it as the answer if nobody has a better one. $\endgroup$ May 29 '18 at 7:09
  • 1
    $\begingroup$ That's...not remotely an answer, though. It's just a file format. You wanted to ask a general question, so you'll get general answers about how to approach the problem. Saying "use this data format" doesn't really answer your question at all. $\endgroup$ May 29 '18 at 16:14
  • $\begingroup$ I was thinking more about the associated cheatsheet that does have a general-ish description of how skinning works and of the math involved, but yeah, either way it's not complete by itself. $\endgroup$ May 29 '18 at 16:55

First decide how you are going to animate the model.

The simplest way is to just have a separate mesh per frame of animation. This requires more memory to be dedicated to mesh data more artist time to create them and it locks you into only those poses.

The next step upwards is interpolating between full meshes (keyword morph targets). This works great for facial expressions especially if you can give different weights for each vertex. It's not that great for full body animation because it's difficult to get proper circular motion into it.

The most common technique for full body animation is skeletal animation. Instead of full meshes for each frame of animation you instead have a set of model transform per "bone" and each vertex has a set of weights to decide which bones it follows. In the vertex shader you then interpolate the transforms as appropriate and then apply the interpolated transform to the vertex. This has the upside that different meshes can use the same animation data assuming the bones are set up the same.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.