Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.

Similar presentations


Presentation on theme: "CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai."— Presentation transcript:

1 CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai

2 Outline Keyframe interpolation Curve representation and interpolation - natural cubic curves - Hermite curves - Bezier curves Required readings: 12-6 & 14-1 14-214-3 14-4, & 14-7

3 Computer Animation Animation - making objects moving Compute animation - the production of consecutive images, which, when displayed, convey a feeling of motion.

4 Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down

5 Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down Natural phenomenon - water, fire, smoke, mud, etc.

6 Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down Natural phenomenon - water, fire, smoke, mud, etc. Character animation - articulated motion, e.g. full-body animation - deformation, e.g. face

7 Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down Natural phenomenon - water, fire, smoke, mud, etc. Character animation - articulated motion, e.g. full-body animation - deformation, e.g. face Cartoon animation

8 Animation Criterion Physically correct - rigid body-simulation - natural phenomenon Natural looking - character animation Expressive - cartoon animation

9 Keyframe Animation

10 Keyframe Interpolation Key frame interpolation in after effects (Click here)here

11 Spatial Key Framing Demo video (click here)here

12 Keyframe Interpolation IK can be used to create Key poses t=0 t=50ms

13 Keyframe Interpolation What’s the inbetween motion? t=0 t=50ms

14 Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control

15 2D Animation Highly skilled animators draw the key frames Less skilled (lower paid) animators draw the in- between frames Time consuming process Difficult to create physically realistic animation

16 Animating a Bouncing Ball Key frames

17 Animating Three Walking Steps Key frames

18 Playing Basketball

19 3D Animation Animators specify important key frames in 3D Computers generates the in-between frames Some dynamic motion can be done by computers (hair, clothes, etc) Still time consuming; Pixar spent four years producing Toy Story

20 3D Bouncing Ball

21 3D Jumping

22 The Process of Keyframing Specify the keyframes Specify the type of interpolation - linear, cubic, parametric curves Specify the speed profile of the interpolation - constant velocity, ease-in-ease-out, etc Computer generates the in-between frames

23 A Keyframe In 2D animation, a keyframe is usually a single image In 3D animation, each keyframe is defined by a set of parameters

24 Keyframe Parameters What are the parameters? –position and orientation –body deformation –facial features –hair and clothing –lights and cameras

25 Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control

26 Inbetween Frames Linear interpolation Cubic curve interpolation

27 Keyframe Interpolation t=0 t=50ms

28 Linear Interpolation Linearly interpolate the parameters between keyframes t x t0t0 t1t1 x0x0 x1x1

29 Linear Interpolation: Limitations Requires a large number of key frames when the motion is highly nonlinear.

30 Cubic Curve Interpolation We can use a cubic function to represent a 1D curve

31 Smooth Curves Controlling the shape of the curve

32 Smooth Curves Controlling the shape of the curve

33 Smooth Curves Controlling the shape of the curve

34 Smooth Curves Controlling the shape of the curve

35 Smooth Curves Controlling the shape of the curve

36 Smooth Curves Controlling the shape of the curve

37 Constraints on the cubics How many points do we need to determine a cubic curve?

38 Constraints on the Cubic Functions How many points do we need to determine a cubic curve?

39 Constraints on the Cubic Functions How many points do we need to determine a cubic curve? 4

40 Constraints on the Cubic Functions How many points do we need to determine a cubic curve? 4

41 Natural Cubic Curves Q(t 1 )Q(t 2 )Q(t 3 ) Q(t 4 )

42 Interpolation Find a polynomial that passes through specified values

43 Interpolation Find a polynomial that passes through specified values

44 Interpolation Find a polynomial that passes through specified values

45 Interpolation Find a polynomial that passes through specified values

46 2D Trajectory Interpolation Each point on the trajectory is associated with a time stamp t. Perform interpolation for each component separately Combine result to obtain parametric curve

47 2D Trajectory Interpolation Each point on the trajectory is associated with a time stamp t. Perform interpolation for each component separately Combine result to obtain parametric curve

48 2D Trajectory Interpolation Each point on the trajectory is associated with a time stamp t. Perform interpolation for each component separately Combine result to obtain parametric curve

49 Limitation? What’s the main limitation of interpolation using natural cubic curves?

50 Limitation? What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve

51 Constraints on the Cubic Curves What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve

52 Constraints on the Cubic Curves What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve Changes of any control point will change the shape of the whole curve!

53 Constraints on the Cubic Curves What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG

54 Constraints on the cubic curves What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG MG

55 Constraints on the Cubic Curves What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG M G

56 Constraints on the Cubic Curves What’s the main limitation of interpolation using natural cubic curves? - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG M? G?

57 Two Issues How to select a new set of control points for local control of the curve? How to determine M? M?

58 Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control

59 Hermite Curve A Hermite curve is determined by - endpoints P 1 and P 4 - tangent vectors R 1 and R 4 at the endpoints P1P1 R1R1 P4P4 R4R4

60 Hermite Curve A Hermite curve is determined by - endpoints P 1 and P 4 - tangent vectors R 1 and R 4 at the endpoints Use these elements to control the curve, i.e. construct control vector P1P1 R1R1 P4P4 R4R4 MhMh GhGh 0<=t<=1

61 Hermite Basis Matrix Given desired constraints: - endpoints meet P 1 and P 4 Q(0) = [0 0 0 1 ] · M h · G h = P 1 Q(1) = [1 1 1 1 ] · M h · G h = P 4 - tangent vectors meet R 1 and R 4

62 Tangent Vectors

63

64 Hermite Basis Matrix Given desired constraints: - endpoints meet P 1 and P 4 Q(0) = [0 0 0 1 ] · M h · G h = P 1 Q(1) = [1 1 1 1 ] · M h · G h = P 4 - tangent vectors meet R 1 and R 4 Q’(0) =[0 0 1 0] · M h · G h =R 1 Q’(1) =[3 2 1 0] · M h · G h =R 4

65 Hermite Basis Matrix Given desired constraints: - endpoints meet P 1 and P 4 Q(0) = [0 0 0 1 ] · M h · G h = P 1 Q(1) = [1 1 1 1 ] · M h · G h = P 4 - tangent vectors meet R 1 and R 4 Q’(0) =[0 0 1 0] · M h · G h =R 1 Q’(1) =[3 2 1 0] · M h · G h =R 4 So how to compute the basis matrix M h ?

66 Hermite Basis Matrix Taking them together Q(0) = [0 0 0 1 ] · Mh · Gh = P1 Q(1) = [1 1 1 1 ] · Mh · Gh = P4 Q’(0) = [0 0 1 0] · Mh · Gh = R1 Q’(1) = [3 2 1 0] · Mh · Gh = R4

67 Hermite Basis Matrix We can solve for basis matrix M h MhMh

68 Hermite Basis Matrix We can solve for basis matrix M h MhMh

69 Hermite Basis Matrix P1P1 R1R1 P4P4 R4R4

70 Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points P1P1 P3P3 P2P2 P4P4

71 Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points -The curve starts at P1 going towards P2 and Arrives at P4 coming from the direction P3 - usually does not pass through P2 or P3; these points are only there to provide directional information. P1P1 P3P3 P2P2 P4P4

72 Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points P1P1 P3P3 P2P2 P4P4

73 Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points How to compute the basis matrix M b ? P1P1 P3P3 P2P2 P4P4

74 Bezier Basis Matrix Establish the relation between Hermite and Bezier control vectors

75 Bezier Basis Matrix Establish the relation between Hermite and Bezier control vectors

76 Bezier Basis Matrix Establish the relation between Hermite and Bezier control vectors M hb GbGb

77 Bezier Basis Matrix For Hermite curves, we have For Bezier curves, we have

78 Bezier Basis Matrix For Hermite curves, we have For Bezier curves, we have

79 Bezier Basis Matrix P1P1 P3P3 P2P2 P4P4

80 Hermite Basis Function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h

81 Hermite Basis Function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h What’s function of this red curve?

82 Hermite Basis Function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h What’s function of this red curve? 2t 3 -3t 2 +1

83 Bezier Basis Functions Bezier blending functions are also called Bernstein polynomials

84 Bezier Basis Functions Bezier blending functions are also called Bernstein polynomials What’s function of this red curve?

85 Bezier Basis Functions Bezier blending functions are also called Bernstein polynomials What’s function of this red curve? B 1 = -t 3 +3t 2 -3t+1

86 Bezier Basis Functions Bezier blending functions are also called Bernstein polynomials What’s function of this red curve? B 2 = -t 3 +3t 2 -3t+1

87 Bezier Basis Functions Bezier blending functions are also called Bernstein polynomials What’s function of the Bezier curve? B 1 P 1 +B 2 P 2 +B 3 P 3 +B 4 P 4

88 How to interpolate a 3D curve x y z o

89 x y z o Bezier curve

90 Try this online at - Move the interpolation point, see how the others (and the point on curve) move - Control points (can even make loops) Bezier java applet http://www.cse.unsw.edu.au/~lambert/splines/

91 Cubic curves: Hermite curves: Bezier curves: Different basis functions

92 Complex curves Suppose we want to draw a more complex curve

93 Complex curves Suppose we want to draw a more complex curve How can we represent this curve?

94 Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control

95 Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers

96 Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers

97 Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers

98 Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers Why cubic? - Lowest dimension with control for the second derivative - Lowest dimension for non-planar polynomial curves

99 Next lecture Spline curve and more key frame interpolation


Download ppt "CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai."

Similar presentations


Ads by Google