In the previous post “Cascadeur - is it possible to replace stuntmen?” We promised to tell you more about the program concept and the tools that allow animators to create physically correct movements of the characters.
In classical animation, the laws of physics are violated for the sake of enhancing effect and expressiveness. The free circulation of the laws of physics and even the creation of its laws, to which the viewer is getting used to, is an important animation tool. But such a style is perceived by the audience as “cartoon”.
And what will happen if the animation strictly abide by Newton's laws and use only those animation techniques that do not contradict these laws? Such physical correctness in itself will not give realism, but can give the effect of integrity. Indeed, in this case, the character moves in space strictly in accordance with our laws of physics, he has mass, inertia, and all his movements are determined by forces. ')
For a long time, physical modeling has been used for realistic animation of passive structures: the collision of solids, the movement of tissues, hair, etc. Hardly anyone would argue with the fact that it is unreasonably difficult to manually animate the fabric. It would be logical to use physical modeling in the animation of the characters' bodies.
But how to calculate the realistic movement of the character, which, unlike the passive structures, itself generates the forces that set the body parts in motion? How can an animator ensure that this movement does not contradict the laws of physics?
When studying this question, we managed to distinguish 3 concepts, the correct handling of which guarantees compliance with Newton's laws:
Pivot points
Center of mass
Moment of impulse
If we follow certain rules with respect to these concepts, then it is enough that even a complex object (with hundreds of degrees of freedom) obeys the laws of Newton entirely. This of course does not remove from the animator the concern for expressiveness, naturalness and other characteristics of movement.
Since in most movements air resistance can be neglected, the rules can be formulated as follows:
1) If the character does not have points of support, then:
The center of mass moves along a ballistic curve (parabola), no matter what kind of movements the character makes.
The moment of the impulse is kept constant, no matter what movements the character makes. That is, neither the axis of rotation, nor the amount of rotation can change, as long as the character does not have points of support.
2) If there are points of support, then:
Any change in the trajectory of the center of mass means that it is affected by a force equal to the strength of the impact of the character on the support (for example, on the floor) and directed in the opposite direction.
Any change in angular momentum corresponds to certain forces at the points of support, which should not contradict the restrictions of the support. For example, the pressure on the floor may be downward, but not upward.
Compliance with these rules turns into a difficult task for each movement. Usually one has to study motion in order to understand how it is done in reality.
But even if a solution is found, a special tool suggests itself that allows you to control the center of mass and the angular momentum directly, and this is the inverse problem of dynamics, and it requires iterative methods of solution. All algorithms in Cascadeur are built on iterative methods.
The main iterative method used to model physics and most tools is Verlet’s numerical integration. The main feature of the method is the ability to impose several different constraints on the system and iteratively find solutions that satisfy all constraints. On this, we may dwell on one of the following posts.
A character in our system consists of vertices with masses and connections connecting vertices. When editing a frame, any manipulations with the character are similar to actions with a physical object in a viscous environment.
This approach allowed us to implement the following features and tools in Cascadeur:
You can move the character for any vertex, while the position of the connected vertices will change, as they are part of the overall system.
A vertex can be fixed, then manipulations with neighboring vertices will not affect its position.
The center of mass can be moved - then all vertices that are not fixed are shifted. If there are fixed vertices, then the character's pose will change.
The center of mass can be fixed - then the movement of any vertex leads to such a movement of loose peaks, in which the center of mass remains in place.
For the center of mass, you can automatically build a ballistic trajectory based on the initial and final position.
The moment of the impulse can be “smoothed out” and made constant on the interval. This changes the position and position of the character in each frame.
The moment of impulse can be fixed. Then the shift of any vertex will lead to such a rotation of the whole character relative to the center of mass c, at which the angular momentum remains unchanged.
At the vertices of the center of mass and angular momentum, the trajectories of motion are unified (given by simple arrays of coordinates) and various filters can be applied to them.
You can calculate the required muscle tension in each frame and display these stresses by the color gradation of the muscles. The ability to see the distribution of the load on the character helps to assess the accuracy of the movement.
You can calculate and display the force vector at each point of support. It also helps to assess the correctness of the movement.
How these tools are used in the work on the example of a simple jump can be viewed in this video:
Advantages of this approach:
The animated character is perceived by the viewer as an object with a mass, and therefore more real. As a result, it is easier to achieve realism.
Movements are more holistic and compatible with each other, even if made by different people (even with different quality).
Such movements are better compatible with movements captured by motion capture.
The fantasy of the animator is not as severely limited as when using motion capture. Nothing prevents to make movements that no stuntman in the world can do.
For the time being we are only developing this approach and exploring its possibilities, inventing and trying new tools. We will keep you informed about the results of our research.