Games104 Introduction to modern game engines-lecture8 game engine animation technology foundation

1 History of animation

insert image description here

The image remains on our retina for 1/24s.
insert image description here
Diorama
insert image description here
Game animation is based on the film industry. Constantly approaching the effect of offline rendering.
Zafari is the first animation made by a game engine.

insert image description here
The basis of animation: it is made by frame by frame. Then use the capture system to do it again.
insert image description here

2 History of game engine animation

Doom is actually made in 2D. It is the originator of game animation.
insert image description here
insert image description here

3 challenge in game Animation

1 interaction

insert image description here

2 real time

Can't figure it out,
the animation data is large
, and the animation compression solves this problem.
insert image description here

3 true

Emoticons are hard.
insert image description here

4 Basics of Animation Techniques

insert image description here

1 2D animation

insert image description here

insert image description here

animation sequence frames.
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

insert image description here

2 3D animation

1 DoF

insert image description here

6DOF: translation of xyz, rotation of xyz
insert image description here
Make a tree structure for each joint of the character.

insert image description here

2 Vertex animation: write down the position of the vertices of each frame.

insert image description here

Vertex animation:
insert image description here
insert image description here

When the rigid body skeleton is moving, the skin is also moving. It is because each vertex is moving multiple bones.
insert image description here
insert image description here

Cloth simulation is the hardest part of animation.
insert image description here

To create an animation:
insert image description here

3 Realization of skinning (important)

1 How to create a mesh

insert image description here

2 different spaces

world space:
Model space: my own coordinate system
Local space: local coordinate system, the coordinate system of each bone is different, a certain coordinate system in the animation system is calculated from the coordinate system of other bones. Only by calculating its model coordinate system from the root node through local space can it calculate its world coordinate system and then render.

The relationship between the model coordinate system and the world coordinate system

insert image description here

3 Creation of bones

Unified a bone structure
insert image description here

Stored shutdown data

insert image description here
Added some weird bones. Many props are added to the skeleton.
insert image description here

insert image description here

Root Joint: Very important. express his position.
insert image description here

Bind point: Binding animation.
insert image description here

T-pose:
Now use A-pose
insert image description here
bone pose

insert image description here

4 Math of 3D rotation

1 2D rotation

insert image description here

2 3D rotation

Rotate around each axis in turn.

insert image description here

1 Euler angles:

It is often used when editing or placing objects, but Euler angles cannot be used when animating.
insert image description here
The problem with Euler angles: the advantage is that it conforms to human perception
(1) Strict order dependence: the order is different, and the results he calculates are different.
insert image description here
(2) Universal joint: universal lock

Integrating its upward direction along the time axis with its velocity, its trajectory can be calculated.
insert image description here
(3) Difficult
insert image description here
to interpolate (4) Difficult to superimpose rotations
(5) Difficult to rotate along a fixed axis.
insert image description here

2 quaternions

It works in three-dimensional space.
insert image description here
insert image description here
The definition of quaternion is as follows:
insert image description here
the formula for converting Euler angle into quaternion is as follows:

insert image description here
The calculation of quaternion and matrix is ​​very similar;

insert image description here

Convert quaternion to rotation matrix:
insert image description here

The reverse rotation formula, rotation superposition, and the quaternion formula for rotating one vector to another vector are as follows: The
insert image description here
rotation formula for a given axis is as follows:
insert image description here

5 Joint Pose - Orientation

The expression of rotation is the core of animation
insert image description here

6 Joint Pose - Positon;

insert image description here

7 Joint Pose - Scale

insert image description here

8 Joint Pose - Affine Matrix

This matrix is ​​important for Africa.
insert image description here

9 Joint Pose -Local Space to Model space

insert image description here

10 Joint Pose Interpolation - local space Vs Model space

insert image description here

11 Joint Skinning Matirix

animation matrix.

insert image description here

There is an identity: the joint moves, and the relative relationship between any point on the skin and the joint does not change.
insert image description here

This formula is very important.

insert image description here
Find the inverse of the matrix in advance and store it.
insert image description here
insert image description here

insert image description here

Vertex interpolation must be done in model space: (below) do not do it in local space.

insert image description here

insert image description here

insert image description here

Displacement and Scale Interpolation
insert image description here

Rotational interpolation is hard and must be done with quaternions.

insert image description here

Interpolation of the shortest path.
insert image description here
The problem with this is: the speed is not uniform, it starts fast, then slow, and finally fast again, the animation looks unnatural.
insert image description here

insert image description here

If the two angles are small, use NLERP, and if the two angles are large, use SLERP.

insert image description here

4 animation pipeline

insert image description here

5 animation compression

insert image description here
The amount of data is large,

Scaling and displacement are constant, mostly rotation is changing.
insert image description here

1 storage with fewer degrees of freedom

insert image description here

2 keyframes

insert image description here
Always ensure that your error is less than your threshold
insert image description here

CatMull curve

Very smooth, approaching bit by bit.
insert image description here
insert image description here

3 floats

insert image description here
insert image description here

A quaternion has 6 bites. Compressed by 60%.
insert image description here

insert image description here

4 Problems caused by compression

will make this compression error propagate until the error is large.
Different bones have different sensitivity to error.
insert image description here

insert image description here

insert image description here
The quality of visual error
insert image description here
compression is an important research area

insert image description here
error compensation.

insert image description here
insert image description here

The data will definitely be compressed, but there will be some visual errors

5 Animation DDC

insert image description here
insert image description here
insert image description here

insert image description here

insert image description here
insert image description here
insert image description here
insert image description here

insert image description here

5 videos

https://www.bilibili.com/video/BV1jr4y1t7WR/?spm_id_from=333.788&vd_source=5c9c50b5a07b211beafdf65d7cc7f8c8

Guess you like

Origin blog.csdn.net/qq_41286360/article/details/125286789
Recommended