<p>First decide how you are going to animate the model.</p>

<p>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.</p>

<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2018-05-29T10:03:48.753Z
2018-05-29T10:03:48.753Z
ratchet freak
<p>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.</p>

<p>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?</p>

<p>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")</p>

CC BY-SA 4.0
2018-05-29T07:09:03.957Z
I just stumbled on [glTF](https://github.com/KhronosGroup/glTF) which is pretty wide and instructive; I might add it as the answer if nobody has a better one.
Narrateur du chaos
CC BY-SA 4.0
2018-05-29T16:14:31.717Z
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.
Christian Rau
CC BY-SA 4.0
2018-05-29T16:55:23.760Z
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.
Narrateur du chaos
<3d><animation>
Which techniques do I need to animate a 3D model in my homemade engine
Narrateur du chaos
# Which techniques do I need to animate a 3D model in my homemade engine

(Asked by: username_0 on 2018-05-29)

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")

**Tags:** 3d, animation

> **Comments:**
> **username_0**: I just stumbled on [glTF](https://github.com/KhronosGroup/glTF) which is pretty wide and instructive; I might add it as the answer if nobody has a better one.  
> **username_1**: 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.  
> **username_0**: 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.  

---

## 1 answers

### Answer by username_2 on 2018-05-29. Score: 2 | Accepted answer

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.


---

