# How do the characters in games and CG move?

Let me talk about the article about making cartoon water effects, which will be updated soon. Before the school was over, I was busy and I didn’t have time to write articles.
Hello, everyone. I haven’t seen you in a long time. Today I will write a popular science article, mainly to pave the way for the next article on animation. Okay, let’s just start talking

Principle of 3D model

To understand the principles of 3D animation, we must first understand the principles of 3D models. As shown in the figure below, a simplest three-dimensional cube is composed of eight vertices.

To make this model deform a little, just modify the position of one of the vertices. In other words, the basic information that constitutes a three-dimensional model is points, lines, and surfaces.

The most basic 3D animation

In a three-dimensional space, all the actions an object can do, in fact, are nothing more than three: move, rotate, and zoom. If we don’t consider changing colors and the like, the most basic 3D animation is indeed composed of the three mentioned above.

Move, zoom, and rotate icons in modeling software C4D

These three can act on the object itself, allowing the entire object to move, rotate, and scale. It can also act on any one or more of points, lines, and surfaces to cause deformation of the object. For example:

This is the most basic animation. This kind of animation can also be called vertex animation, which is an animation that is modified vertex by vertex. Animations that modify edges or faces individually are also regarded as vertex animations, because modifying edges and faces is essentially modifying points. It should be noted here that it is generally meaningless to rotate and scale vertices, because the connection between vertices and vertices is generally not affected by the current orientation angle of the vertices, and the vertices themselves have no spatial size, so for their scaling It will not produce any changes.

Although relying on the movement, rotation, and scaling of objects, points, lines, and surfaces, it can theoretically help us realize any animation that may or may not appear in the real three-dimensional world. However, when we start making character animations, we will quickly run into trouble. A human body model usually has thousands, tens of thousands, or even millions of vertices.
For example, the monster model shown below:

This model is considered a low poly model. With fine textures, there is no problem in top-down games such as “DOTA” or “LOL”, or high-quality mobile games.

And he has 5851 vertices and 6,994 faces. If we want to manually adjust so many vertices, it is already a nightmare, let alone 3A games or models in movies. Moreover, for creatures without a hard outer skin, the skin often exhibits various stretches and deformations during exercise, which also brings great obstacles to the creation of vertex animations for creatures.

Therefore, people came up with a coup. The soft tissues with many vertices such as human skin and muscles are actually attached to the bones, and the bones themselves do not produce much deformation, so we refer to the reality. With this phenomenon, let the models of these soft-surfaced creatures also attach themselves to the bones, isn’t it complete?

Therefore, the concept of bones came into being. People do not need to move so many vertices, but to move and rotate this virtual bone, so that the model can be deformed reasonably to make it look like it is in motion. .

However, we seem to overlook an important step. We have a model and bones, but how do we tell the computer how the bones affect the model? At this time we have a job called skinning (rigging, Rigging), that is, we first need to tell the computer which vertices each bone will affect, and how much affect these vertices. This step can usually be handed over to the computer for rough automatic skinning first, and then manual fine adjustments.

The above picture is that when we finish the skinning work, we can see that a bone affects those nodes and the extent of its influence. In the above figure, we have selected the bones of the pelvis. It can be seen that the closer the color is to bright red, the stronger the influence of the pelvic bones on it, and the closer to pure black, the weaker the influence of the pelvic bones on it.

Tips: The pelvic bones are generally the root bones of humanoid creatures. The so-called root bone means that all other bones grow out of this root bone. Moving the root bone will move with all other bones.

If we use different colors to represent the influence of different bones, then we can get the influence distribution of all bones as shown in the following figure:

Then, we animate the skeleton and the effect comes out.

In this way, we can easily complete the animation. Moreover, compared to recording vertex animations of many vertices, only recording bone information can greatly reduce the size of the animation file.
In the actual animation production process, simply adjusting these bones is still not the fastest method. There are many ways to speed up the process of using bones, such as controllers and constraints. But these are all things to do, and they are not in today’s category.

Next, I will soon update an article about using 3D models to make 2D pixel animations, and then there will be the previous cartoon water special effects. Let me give you a preview of the effect:

It only took less than 20 minutes to simply produce this animation, and the efficiency is still very high. (The process of modeling, tying bones, and making renderers is not included here, but only includes the production of 3D and 2D animation)

Finally, it’s time to bring the goods. Let’s talk about the dialogue line editor I made on the Unity Asset Store. This is a tool that allows you to write lines with multiple branches and multiple options in a visual way. Support localization in any language. And you don’t need to write a line of code to use a lot of dialogue effects. At present, it has received five-star praise in the store. Here to share the development process and a complete tutorial. If you find it easy to use, don’t forget to leave a good comment on the Asset Store.