Game character modelling_and_animation

Post on 14-Jan-2015

944 views 1 download

description

charater skin

Transcript of Game character modelling_and_animation

1

Modelling & Animationof

3D Game Characters

Edmond Prakash

Edmond.Prakash@beds.ac.uk

204/10/23 2

11SkinSkin

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!

4

Overview

• Character: A Hierarchical Structure• Modeling Characters for Animation

– Deformable Mesh– Bones– Constraints

5

Some characters

6

Some characters

7

Some characters

8

A Hierarchical Structure

9

Overview

• Character: A Hierarchical Structure• Modeling Characters for Animation

– Deformable Mesh– Bones– Constraints

10

Question

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

bones)– Deformation with bones

11

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

12

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

13

Overview

• Character: A Hierarchical Structure• Modeling Characters for Animation

– Deformable Mesh– Skin and Bones– Constraints

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.

15

Reference & Animated

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

16

Bones – New Posture

vertexCnt

nnbFinal VMV

0

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

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;

18

Vertex Blending

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

19

Why does skin collapse happen?

20

Fencing

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

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

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.

23

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

24

Shoulder

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

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

26

Overview

• Character Design and Concepts• Modeling Characters for Animation

– Deformable Mesh– Bones– Constraints

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.

28

Constraints

Arc Representation of Constraints Joint constraints limit arm movement

29

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

Acting out an action gives a clearer understanding of…

– Movement– Positioning– Timing– Attitude

30

Question

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

bones)– Deformation with bones

Both groups are pushing hard!

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?

3204/10/23 32

22Walk

33

How would you animate the human walk?

34

Degrees of FreedomDOFs

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.

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

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

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)

39

Automated Walking- How to write a Program?

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.

41

Forward Kinematics (FK) vs Inverse Kinematics (IK)

• Input angles (posture)• Compute position P

• Input position P• Compute angles (posture)

42

Flexing Knee (Lift Foot)

43

Flexing Knee (Sit)

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.

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;

46

Animation Based on Motion Data

• Photographs

47

Uses Only 2 Photographs

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

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

50

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

Walk Demo Links!

Try This Walk!

5104/10/23 51

33Arm ReachArm Reach

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

53

Model of the Human Arm

Shoulder(3 DOFs)

Elbow (1 DOF)

Wrist (3 DOF)

End Effector (hand and fingers)

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

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.

56

Algorithm for prediction of arm reach posture

57

Examples

• Different arm postures

58

Examples

• Touching the nose

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

60

Joint Limits

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

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.

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.

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

64

Arm Movement: Path, IK, Collision

65

Arm Movement: Path, IK, Collision

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

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

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.

69

Two Arms to Reach Spectacles• Koga et. al.

Siggraph 1994

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

71

Distant Reach

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

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

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.

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.