Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.

Similar presentations


Presentation on theme: "CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai."— Presentation transcript:

1 CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai

2 Key-frame Interpolation Given parameter values at key frames, how to interpolate parameter values for inbetween frames. θ t

3 Key-frame Interpolation Given parameter values at key frames, how to interpolate parameter values for inbetween frames. t θ

4 Key-frame Interpolation Given parameter values at key frames, how to interpolate parameter values for inbetween frames. t θ Nonlinear interpolation

5 Review: Natural cubic cruves

6

7

8 Review: Natural cubic curves Properties: - Go through four control points - not good for local control

9 Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 P 1 : start position P 4 : end position R 1 : start derivative R 4 : end derivative

10 Review: Hermite Curves P1P1 R1R1 P4P4 R4R4

11 P1P1 R1R1 P4P4 R4R4 Herminte basis matrix

12 Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 Herminte basis matrix

13 Review: Hermite Curves P1P1 R1R1 P4P4 R4R4

14 P1P1 R1R1 P4P4 R4R4

15 P1P1 R1R1 P4P4 R4R4

16 P1P1 R1R1 P4P4 R4R4

17 P1P1 R1R1 P4P4 R4R4 Hermite basis functions

18 Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 basis function 1basis function 2basis function 3 basis function 4

19 Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 *P 1 *P 4 *R 1 *R 4 +++ =

20 Review: Bezier Curves

21

22

23

24 *v 0 *v 1 *v 2 *v 3 +++ =

25 Cubic curves: Hermite curves: Bezier curves: Review: Different basis functions

26 Complex curves Suppose we want to draw or interpolate a more complex curve

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

28 Complex curves Suppose we want to draw a more complex curve Idea: we’ll splice together a curve from individual segments that are cubic Béziers

29 Complex curves Suppose we want to draw or interpolate a more complex curve Idea: we’ll splice together a curve from individual segments that are cubic Béziers

30 Splines A piecewise polynomial that has a locally very simple form, yet be globally flexible and smooth

31 Splines There are three nice properties of splines we’d like to have - Continuity - Local control - Interpolation

32 Continuity C 0 : points coincide, velocities don’t C 1 : points and velocities coincide What’s C 2 ? - points, velocities and accelerations coincide

33 Continuity Cubic curves are continuous and differentiable We only need to worry about the derivatives at the endpoints when two curves meet

34 Local control We’d like our spline to have local control - that is, have each control point affect some well-defined neighborhood around that point

35 Local control We’d like our spline to have local control - that is, have each control point affect some well-defined neighborhood around that point

36 Local control We’d like our spline to have local control - that is, have each control point affect some well-defined neighborhood around that point

37 Interpolation Bézier curves are approximating - The curve does not (necessarily) pass through all the control points - Each point pulls the curve toward it, but other points are pulling as well - the curve is always located within the convex hull based on control points. Instead, we may prefer a spline that is interpolating - That is, that always passes through every control point

38 B-splines We can join multiple Bezier curves to create B-splines Ensure C 2 continuity when two curves meet

39 Derivatives at end points t=0 t=1

40 Derivatives at end points t=0 t=1

41 Derivatives at end points t=0 t=1

42 Derivatives at end points t=0 t=1

43 Derivatives at end points t=0 t=1

44 Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

45 Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

46 Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

47 Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

48 Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

49 Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

50 Continuity in B splines What does this derived equation mean geometrically? - What is the relationship between a, b and c, if a = 2b - c? b is the middle point of a and c. w 2 =v 1 +4v 3 -4v 2

51 de Boor points Instead of specifying the Bezier control points, let’s specify the corners of the frames that forms a B-spline These points are called de Boor points and the frames are called A-frames

52 de Boor points What is the relationship between Bezier control points and de Boor points? Verify this by yourself!

53 Building complex splines Constraining a Bezier curve made of many segments to be C 2 continuous is a lot of work - for each new segment we have to add 3 new control point - only one of the control points is really free B-splines are easier (and C 2 ) - First specify 4 vertices (de Boor points), then one per segment

54 B splines properties √ Continuity √ Local control x Interpolation

55 Catmull-Rom splines If we are willing to sacrifice C 2 continuity, we can get interpolation and local control. If we set each derivative to be a constant multiple of the vector between the previous and the next control points, we get a Catmull-Rom spline

56 Catmull-Rom splines

57 The segment is controlled by p 1,p 2,p 3,p 4 0.5

58 Catmull-Rom splines The segment is controlled by p 1,p 2,p 3,p 4

59 Catmull-Rom Splines The effect of t: how sharply the curve bends at the control points

60 Catmull-Rom splines The segment is controlled by p 1,p 2,p 3,p 4

61 Catmull-Rom splines From Hermite curves

62 Catmull-Rom splines From Hermite curves

63 Catmull-Rom splines From Hermite curves

64 Catmull-Rom splines

65

66 What do we miss?

67 Catmull-Rom splines ? ?

68

69 Catmull-Rom splines have C 1 continuity (not C 2 continuity) Do not lie within the convex hull of their control points.

70 Catmull-Rom splines Catmull-Rom splines have C 1 continuity (not C 2 continuity) Do not lie within the convex hull of their control points.

71 Catmull-Rom splines properties X Continuity (C 2 ) √ Local control √ Interpolation

72 Catmull-Rome Splines for Kyeframe Interpolation Given a set of control points, interpolation splines are obtained by fitting the input points with a piecewise cubic polynomial curve that passes through every control point

73 Catmull-Rome Splines for Kyeframe Interpolation Fit the interpolation function between each pair of control points with a cubic function p k-1 pkpk P k+1 P k+2

74 Catmull-Rome Splines for Kyeframe Interpolation Fit the interpolation function between each pair of control points with the following cubic function: p k-1 pkpk P k+1 P k+2 0<=u<=1

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

76 Spline parameterization The spline is parameterized by u (0<=u<=1) and not by time t.

77 Spline parameterization The spline is parameterized by u (0<=u<=1) and not by time t. Hard to deal with the questions like -What is the location of point p at time t -What is the velocity of point p at time t -What is the acceleration of point p at time t

78 Spline parameterization Solution: reparameterize the curve in terms of t - express spline as a function of the arc length s: u=g(s) - express the arc length s as a function of t: s=f(t)

79 Speed Control Click herehere

80 Speed control Time warping function to control speed (mapping from the original time line to the output time line) - positive - monotonic; you cannot reverse the time s=f(t) Original timeline new timeline

81 Speed control Simplest form is to have constant velocity along the path s=f(t)

82 Speed control Simplest form is to have constant velocity along the path s=f(t) Which one is “speed up” or which one is “slow down”

83 Speed control Simplest form is to have constant velocity along the path s=f(t) Slow down Speed up

84 Speed control Assume that the motion slows down at the beginning and end of the motion curve s=f(t)

85 Speed control Assume that the motion slows down at the beginning and end of the motion curve s=f(t) Adjust timing for each key frame

86 Arc-length reparameterization Now we want a way to find u given a particular arclength s: u=g(f(t)) Not possible analytically for most curves (e.g. B- splines)

87 Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) What’s parametric value for the arc length.08?

88 Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i )

89 Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) Finite difference What’s parametric value for the arc length.08?

90 Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) What’s parametric value for the arc length.08?

91 Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) What’s parametric value for the arc length.05? A linear interpolation of 0.00 and 0.05

92 Speed control recipe Given a time t, lookup the corresponding arclength S in the speed curve For S, look up the corresponding value of u in the reparameterization table Evaluate the curve at u to obtain the correct interpolated position for the animated object for the given time t


Download ppt "CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai."

Similar presentations


Ads by Google