Animation Blending
to connect two animations
Math of blending: LERP: Linear interpolation.
Take keyframe interpolation between two animations.
Weight1+weight2 is equal to 1.
Both animations must be cyclic. After normalization, they can be consistent with all animations in
the Blend Space
(clips) in the adopted space. , must maintain consistent cyclicity, either all loops or none.
The distribution of sampling points in the mixed space is uneven. If a more delicate expression is needed somewhere, you can add a clip in the corresponding place
instead of using all clips. According to the divided triangle. Interpolate between three adjacent vertices through the center of gravity coordinates.
Some animations only apply to the upper body, and some animations only apply to the lower body. Such a free combination of various upper and lower body animated poses
Only the change amount of the animation is stored, not the absolute amount. No matter how you change the skeleton, apply the delta based on the change.
Three types of blending:
Linear Lerp Blending: Whole body
Mask Blending: Partial
Additive Blending: After blending is completed, the difference amount of modification added
State machine:
frozen mode will first stop animation 1, and then let animation 2 come in.
Multi-layer state machine, different state machines control different parts of the model.
Animation Blend Tree: Animation tree.
Linear interpolation node: input weight
animation individually for each clip. The core of the tree: defines control variables and exposes them to the gameplay system. (Such as speed, direction, whether under attack...)
Control variables will change the blending behavior of the animation tree
Control: 1. Various environmental parameters (speed, blood volume...) 2. Events. When an event occurs, some markers (private variables of the class) inside the animation tree will be modified (switching weapons).
General animations pass the driver layer by layer from the root node to the previous layer.
Inverse dynamics: Inverse solution with constraints, such as a hand grasping a point.
End-effector: end effector.
For example: when moving, you step on uneven ground with various bumps and ridges, and you want to keep your feet on the ground. There will be two Bones IK, the calf and thigh of the model, the two sides of the triangle are determined, the position of the target point to step on is determined, and the distance from the root node (the third side) can be calculated. Identify the only triangle. Calculate the angle of the thigh and calf.
Finally, a reference vector is needed to determine the direction. Otherwise, the 360-degree rotation of the triangle is the correct solution.
Different IK
long chain IK has multiple solutions
to determine whether the bone can reach the target point. 1: All bones are elongated, and the target is judged outward. 2: The longest bone is selected, and the rest are inward, and the target is judged inward. The
range of activity of each bone is also limited.
CCD algorithm
CCD optimization
FABRIK
Retarget
source character and target character, source Animation and target animation
bones correspond one to one.
Transfer the relative amount of bone change
. Translation and scaling change in proportion to the bone length.