Game Animation - 國立臺灣大學

Preview:

Citation preview

Ken-Yi Lee

Game Programming, Fall 2020 @ National Taiwan University

Game Animation

2

Game Programming

● Rendering

● Looping and control

● Math

● Animation

● Physics

● Behaviour and navigation (AI)

● Effects

● Networking

3

Game Programming

● Rendering

● Looping and control

● Math

● Animation

● Physics

● Behaviour and navigation (AI)

● Effects

● Networking

4

6

Demo : 2D Game Kit

● Play

● Introduce scene assets

2D sprite animation

● Keyframes / image sequence

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

Sprite renderer

24

Demo : 2D Game Kit

● Inspect Ellen [Prefab]

25

Animation clip : keyframe animation

26

Demo : 2D Game Kit

● Inspect Ellen prefab

● Inspect Ellen_Idle animation

29

Root motion

30

Root motion

31

Root motion

32

Root motion

33

34

Demo : 2D Game Kit

● Inspect Ellen prefab

● Inspect Ellen_Idle animation

Parametric animation

35

Parametric animation

36

Interpolation between consecutive frames ?

37

Smooth or sharp ?

Parametric animation

Animation clip: Curves

38

● (DEMO) Ellen [Prefab] > Animation > Ellen_IdleWithGun

39

(DEMO)

State machine

40

● Current state ?

● On state enter / leave ?

Jump

Idle

Walk

State machine

41

● Current state ?

● On state enter / leave ?

● Transition between states ?

Jump

Idle

Walk

Animation state machine

42

● Current animation ?

● On animation play / finished ?

● Blending between animations ?

Jump

Idle

Walk

Animator controller

43

44

Animator states

45

(DEMO)

Animator transition

46

BlendTree

47

49

54

55

(DEMO)

Inverse kinematics (IK)

56

Inverse kinematics (IK)

57

Set desired target

Inverse kinematics (IK)

58

Always possible ?

Set desired target

59

(DEMO)

60

3D Model

Skinned mesh renderer

61

62

Rig

63

64

(DEMO)

65

Avatar

66

67

68

(DEMO)

Root motion

69

70

71

(DEMO)

72

74

(DEMO)

BlendTree

75

76

(DEMO)

Retargeting

77

78

79

(DEMO)

Inverse kinematics (IK)

80

Inverse kinematics (IK)

81

Inverse kinematics (IK)

82

83

Q & A

References

84

● Getting Started with Unity’s 2D Animation Package @ Unity Blog

○ https://blogs.unity3d.com/2018/11/09/getting-started-with-unitys-2d-animation-package/

● Mecanim Humanoids @ Unity Blog

○ https://blogs.unity3d.com/2014/05/26/mecanim-humanoids/

● Retargeting and Reusing Animation @ Unity Blog

○ https://learn.unity.com/project/re-targeting-and-re-using-animation

Recommended