Game character modelling_and_animation

75
1 Modelling & Animation of 3D Game Characters Edmond Prakash [email protected]

description

charater skin

Transcript of Game character modelling_and_animation

Page 1: Game character modelling_and_animation

1

Modelling & Animationof

3D Game Characters

Edmond Prakash

[email protected]

Page 2: Game character modelling_and_animation

204/10/23 2

11SkinSkin

Page 3: Game character modelling_and_animation

3

Questions• Where are 3D characters used?• How is a 3D character modelled?• How is a 3D character animated?• What are the modelling & animation concepts? • What are the difficulties?• What are the techniques?• If you are asked to design a tool for character

modelling and animation, what type of support will you provide for (a) the modeller, (b) an animator?

Today we will find some answers for these questions!

Page 4: Game character modelling_and_animation

4

Overview

• Character: A Hierarchical Structure• Modeling Characters for Animation

– Deformable Mesh– Bones– Constraints

Page 5: Game character modelling_and_animation

5

Some characters

Page 6: Game character modelling_and_animation

6

Some characters

Page 7: Game character modelling_and_animation

7

Some characters

Page 8: Game character modelling_and_animation

8

A Hierarchical Structure

Page 9: Game character modelling_and_animation

9

Overview

• Character: A Hierarchical Structure• Modeling Characters for Animation

– Deformable Mesh– Bones– Constraints

Page 10: Game character modelling_and_animation

10

Question

• Which approach is better?– Morphing Skin (deformable mesh with no

bones)– Deformation with bones

Page 11: Game character modelling_and_animation

11

Vertex InterpolationTo animate the characters, a single base model is transformed at the vertex level to create animation (used in Quake).

Page 12: Game character modelling_and_animation

12

Free form deformation of skin• Arm movement • Transform bounding grid• Free form deformation for skin

Page 13: Game character modelling_and_animation

13

Overview

• Character: A Hierarchical Structure• Modeling Characters for Animation

– Deformable Mesh– Skin and Bones– Constraints

Page 14: Game character modelling_and_animation

14

Skeletal Deformation Techniques

• Skinned characters are rapidly becoming the norm in 3D real-time character animation.

• A character created from a single skin eliminates the seams at each joint.

Page 15: Game character modelling_and_animation

15

Reference & Animated

Reference and animated positions, show as (a) bones and cross-sections (b) Skin represented as a rendered surface

Page 16: Game character modelling_and_animation

16

Bones – New Posture

vertexCnt

nnbFinal VMV

0

Each vertex, V, in the object model is transformed by the bone matrix, Mb

Page 17: Game character modelling_and_animation

17

Codeprocedure EvaluateBone(var b: TBone);var i: Integer;begin  ApplyTransformation(b);  with b do

begin  for i := 0 to High(Children) do

begin  ApplyParentTransformation(Children[i]);  EvaluateBone(Children[i]);  end;  end;end;

Page 18: Game character modelling_and_animation

18

Vertex Blending

Vertex Blending (a) before rotation (b) without blending (c) with blending

Page 19: Game character modelling_and_animation

19

Why does skin collapse happen?

Page 20: Game character modelling_and_animation

20

Fencing

Fencing AnnimationReal-life posture: a) vertex blending,b) deformation with bones

Page 21: Game character modelling_and_animation

21

Elbow 180

Elbow twisted 180: a) vertex blending,b) bones blending applied to original mesh, c) bones blending applied to subdivided mesh

choice of tmin and tmax parameters inthe reference posture

Effect of twisting child bone 180 degrees

Page 22: Game character modelling_and_animation

22

Vertex with Blending

vertexCnt

nnbonennbonenFinal VMWVMWV

021 ]*)1(*[

For a skin vertex attached to two bones:

Wn determines the linear blend between the two bone matrices.

Page 23: Game character modelling_and_animation

23

a) Bending Elbows (right side uses Bone Links)b) Twisting Elbows (right side uses Bone Links)

Page 24: Game character modelling_and_animation

24

Shoulder

Normal-Derived Influence Fade (a) without and (b) with

Page 25: Game character modelling_and_animation

25

(a) Estimated Cross-Sections connected with cylinders

(b) Original exported model authored using ellipsoidal regions(c) Same model using Weight Regeneration, Proportional Auto-Smoothing, and Bone Links

Page 26: Game character modelling_and_animation

26

Overview

• Character Design and Concepts• Modeling Characters for Animation

– Deformable Mesh– Bones– Constraints

Page 27: Game character modelling_and_animation

27

Bone Animation Enhancements

• The most obvious enhancements is to add constraints to each bone: minimal and maximal rotation angles that ensure that unrealistic or physically impossible movements can not be executed.

• You could also attach external objects to a bone, so you could put any weapon in the character's hand, for example.

Page 28: Game character modelling_and_animation

28

Constraints

Arc Representation of Constraints Joint constraints limit arm movement

Page 29: Game character modelling_and_animation

29

Summary When In Doubt…Act it out!!!!

Acting out an action gives a clearer understanding of…

– Movement– Positioning– Timing– Attitude

Page 30: Game character modelling_and_animation

30

Question

• Which approach is better?– Morphing Skin (deformable mesh with no

bones)– Deformation with bones

Both groups are pushing hard!

Page 31: Game character modelling_and_animation

31

Coming back to our Questions

• Where are 3D characters used?• How is a 3D character modelled?• How is a 3D character animated?• What are the modelling & animation concepts? • What are the difficulties?• What are the techniques?• If you are asked to design a tool for character

modelling and animation, what type of support will you provide for (a) the modeller, (b) an animator?

Page 32: Game character modelling_and_animation

3204/10/23 32

22Walk

Page 33: Game character modelling_and_animation

33

How would you animate the human walk?

Page 34: Game character modelling_and_animation

34

Degrees of FreedomDOFs

Page 35: Game character modelling_and_animation

35

Main ProblemsThe main problems encountered while designing a walking model depend on the kind of application, but include:– ensuring that the motion of the body parts looks realistic;– verifying that the contact between the human-like figure and the

environment (especially the terrain) is realistic;– accommodating variable grounds such as slope terrains or

stairs;– adapting the motion to the synthetic actor’s anatomy;– personifying the gait, such as making the human-like figure walk

as a woman, be less or more tired, etc.;– accounting for changes in the mechanical structure of the

walker, which makes it possible to modify the motion when it carries heavy objects or is submitted to the wind;

– making the walker react to external events or forces such as pushes or collisions;

– making sure that the forces and torques required to execute the computed motion are realistic.

Page 36: Game character modelling_and_animation

36

Gaits

• A gait refers to a particular sequence of lifting and placing the feet during legged locomotion (gallop, trot, walk, run…)

• Each repetition of the sequence is called a gait cycle• The time taken in one complete cycle is the gait period• Normally, in one gait cycle, each leg goes through

exactly one complete step cycle

Page 37: Game character modelling_and_animation

37

singlesupport

singlesupport

doublesupport

doublesupport

left heel strike left heel strikeright heel strike

left stance

right stanceright stance right swing

left swing

right toe off ground left toe off ground

left leg

right leg

one cycle (stride)

Walk Cycle

Page 38: Game character modelling_and_animation

38

Run Cycle

flightflight

singlesupport

singlesupport

left heel strike left heel strikeright heel strike

left stance

right stanceright swing right swing

left swing

left toe off ground right toe off ground

one cycle (stride)

Page 39: Game character modelling_and_animation

39

Automated Walking- How to write a Program?

Page 40: Game character modelling_and_animation

40

Three Approaches

1. Procedural methods based on posture based kinematic animation.

2. The attempts to incorporate dynamic constraints in the generation of motion or to use dynamic simulation.

3. Approaches enabling the interactive editing of either captured or synthetic walking motions.

Page 41: Game character modelling_and_animation

41

Forward Kinematics (FK) vs Inverse Kinematics (IK)

• Input angles (posture)• Compute position P

• Input position P• Compute angles (posture)

Page 42: Game character modelling_and_animation

42

Flexing Knee (Lift Foot)

Page 43: Game character modelling_and_animation

43

Flexing Knee (Sit)

Page 44: Game character modelling_and_animation

44

Designing A Controller

• Controlled by high level parameters such as step length and step frequency.

• Several states which control the gait of a synthetic skeleton.

• A key posture is associated with each state. • These postures are linearly interpolated to produce in-

between angular values.

Page 45: Game character modelling_and_animation

45

Dynamics

• In many cases, accounting for dynamics is essential to ensure that the motion is realistic:– if the synthetic actor has to carry loads;– if the human-like figure has to react to

external forces such as pushes or the wind;– if the ground is complex, such as stairs or

slope terrains;

Page 46: Game character modelling_and_animation

46

Animation Based on Motion Data

• Photographs

Page 47: Game character modelling_and_animation

47

Uses Only 2 Photographs

Page 48: Game character modelling_and_animation

48

Walk++

• Walk Cycle• Posture During Walk

– Hip Movement– Shoulder Movement– Head Movement– Hand Movement

• Posture During Turn• Posture on Flat Ground vs Hilly Terrain

Page 49: Game character modelling_and_animation

49

Variations of Walk

• Normal Cyclic Walk• Brisk Walk• Running• Walk Behaviour (Subtle Variations)

– Male vs Female– Sad vs Happy– Heavy vs Light– Nervous vs Relaxed

Page 50: Game character modelling_and_animation

50

http://www.biomotionlab.ca/Demos/BMLwalker.html

Walk Demo Links!

Try This Walk!

Page 51: Game character modelling_and_animation

5104/10/23 51

33Arm ReachArm Reach

Page 52: Game character modelling_and_animation

52

Arm Reach Posture

• Tasks– Lifting a telephone– Opening a door– Lifting a coffee mug– Opening a bottle

• Terminology– Shoulder joint (3-DOF)– Elbow joint (1-DOF)– Wrist (3-DOF)– Sinus Cone / Sphere Polygon

Page 53: Game character modelling_and_animation

53

Model of the Human Arm

Shoulder(3 DOFs)

Elbow (1 DOF)

Wrist (3 DOF)

End Effector (hand and fingers)

Page 54: Game character modelling_and_animation

54

Overview

1. Arm Reach Posture & Terminology

2. Geometric Algorithm for Reach

3. Shoulder Joint Constraint Specification

Sinus Cone vs Spherical Polygon4. Path, Collision, Reach Animation

5. Animation of Two Arm Collaboration

Page 55: Game character modelling_and_animation

55

Arm Reach - Kinematics

• The shoulder and elbow joints are represented by S and E.

• A reference hand point is designated by W.

• The hand velocity ṙw can be decomposed into two component vectors, one contributed by the shoulder rotation, ṙws , and the other by the elbow, ṙwe .

• Knowing the elbow rotation flexion–extension axis ae and the hand velocity ṙw, the motions around the shoulder normal axis asn and the elbow aixs ae are completely specified.

Page 56: Game character modelling_and_animation

56

Algorithm for prediction of arm reach posture

Page 57: Game character modelling_and_animation

57

Examples

• Different arm postures

Page 58: Game character modelling_and_animation

58

Examples

• Touching the nose

Page 59: Game character modelling_and_animation

59

Overview

1. Arm Reach Posture & Terminology

2. Geometric Algorithm for Reach

3. Shoulder Joint Constraint Specification

Sinus Cone vs Spherical Polygon4. Path, Collision, Reach Animation

5. Animation of Two Arm Collaboration

Page 60: Game character modelling_and_animation

60

Joint Limits

• Boundary domain for an assembly of 3 independent successive 1-DOF rotational joints

Page 61: Game character modelling_and_animation

61

Globe/Spherical Polygon

• Globe representation of the right shoulder joint sinus and of the upper arm axial motion range.

• The boundary represents the shoulder sinus cone.

• The grey within the cone represents the upper arm axial motion range, which varies from 104° to 160° on average. The darker the grey is, the larger the axial motion range.

• The axes X, Y and Z are defined respectively aligned to the medial–lateral (M–L), posterior–anterior (P–A) and inferior–superior (I–S) anatomical directions.

Page 62: Game character modelling_and_animation

62

Implementation of GIK• Comparison between

two animation sequence without and with sinus cone joint violation detection when the right arm moves behind the torso.

Page 63: Game character modelling_and_animation

63

Overview

1. Arm Reach Posture & Terminology

2. Geometric Algorithm for Reach

3. Shoulder Joint Constraint Specification

Sinus Cone vs Spherical Polygon4. Path, Collision, Reach Animation

5. Animation of Two Arm Collaboration

Page 64: Game character modelling_and_animation

64

Arm Movement: Path, IK, Collision

Page 65: Game character modelling_and_animation

65

Arm Movement: Path, IK, Collision

Page 66: Game character modelling_and_animation

66

Overview

1. Arm Reach Posture & Terminology

2. Geometric Algorithm for Reach

3. Shoulder Joint Constraint Specification

Sinus Cone vs Spherical Polygon4. Path, Collision, Reach Animation

5. Animation of Two Arm Collaboration

Page 67: Game character modelling_and_animation

67

Multi-Arm Animation

• Multi-Arm Manipulation Problem– Must find a path for the arms to hold and then

carry some specified moveable object from its initial location to its desired goal

• Initial and Goal Configurations• Inverse Kinematics of the Arms

Page 68: Game character modelling_and_animation

68

Two Arms to Open A Bottle

• The position of the wrist and the task are specified for both arms.

• The posture for both arms are computed in each iteration.

Page 69: Game character modelling_and_animation

69

Two Arms to Reach Spectacles• Koga et. al.

Siggraph 1994

Page 70: Game character modelling_and_animation

70

Overview

1. Arm Reach Posture & Terminology

2. Geometric Algorithm for Reach

3. Shoulder Joint Constraint Specification

Sinus Cone vs Spherical Polygon4. Path, Collision, Reach Animation

5. Animation of Two Arm Collaboration

6. Distant Reach

Page 71: Game character modelling_and_animation

71

Distant Reach

Page 72: Game character modelling_and_animation

72

Summary of Arm Animation

• Arms have multiple DOF• Posture specified by animator (angles or end

effector positions)• IK for arm posture• Joint limits for realistic posture• Two hand coordination• Distant Reach

Page 73: Game character modelling_and_animation

73

Additional Reading

• Gems I          – Interpolated 3D Keyframe Animation, pp 465-

470         – Simple Skinning, pp. 471-475         – Advanced Animation Using Skinning, pp.  476-

483    • Gems III:

– Improved Deformation of Bones, pp. 384 -393              – Constrained Inverse Kinematics, pp. 192 - 199

• Watt, 3D Game Vol. 2., pp. 347-364.• Animation – How we do it?

http://www.pixar.com/howwedoit/index.html

Page 74: Game character modelling_and_animation

74

References

• Xuguang Wang and Jean Pierre Verriest, A geometric algorithm to predict the arm reach posture for computer-aided ergonomic evaluation, The Journal of Visualization and Computer Animation, 9:33--47, 1998.

• Yoshihito Kogay, Koichi Kondoz, James Kuffnery and Jean-Claude Latombey, Planning Motions with Intentions, SIGGRAPH 1994.

• Ying Liu Norman I. Badler, Real-time Reach Planning for Animated Characters Using Hardware Acceleration, CASA 2003.

Page 75: Game character modelling_and_animation

75

Bibliography

• M. Girard, A. Maciejewski, “Computational Modeling for the Computer Animation of Legged Figures”, SIGGRAPH 1985, Vol. 19, No. 3, 263-270, 1985.

• A. Bruderlin and T. Calvert, Goal-directed, dynamic animation of human walking, SIGGRAPH 1989, Vol. 23, 3, 233-242, 1989.

• F. Multon, L. France, M.P. Cani and G. Debunne, Computer Animation of Human Walking: A Survey, Jl of Visualization and Computer Animation, 10, 39-54, 1999.