Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap 3 Interpolating Values

Similar presentations


Presentation on theme: "Chap 3 Interpolating Values"— Presentation transcript:

1 Chap 3 Interpolating Values
Animation(U), Chap 3, Interpolating Values

2 Outline Interpolating/approximating curves
Controlling the motion of a point along a curve Interpolation of orientation Working with paths Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

3 Interpolation between key frames
Parameters to be interpolated Position of an object Normal Joint angle between two joints Transparency attribute of an object Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

4 Interpolation between key frames
Interpolation between frames is not trivial Appropriate interpolating function Parameterization of the function Maintain the desired control of the interpolated values over time Example (-5,0,0) at frame 22, (5,0,0) art frame 67 Stop at frame 22 and accelerate to reach a max speed by frame 34 Start to decelerate at frame 50 and come to a stop at frame 67 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

5 Interpolation between key frames
desired result undesired result Need a smooth interpolation with user control Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

6 Interpolation between key frames
Solution Generate a space curve Distribute points evenly along curve Speed control: vary points temporally B Time = 10 A Time = 0 C Time = 35 D Time = 60 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

7 Interpolation functions
Interpolation vs. approximation Interpolation Hermite, Catmull-Rom approximation Bezier, B-spline Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

8 Interpolation functions
Complexity => computational efficiency Polynomials Lower than cubic No inflection point, may not fit smoothly to some data points Higher than cubic Doesn’t provide any significant advantages, costly to evaluate Piecewise cubic Provides sufficient smoothness Allows enough flexibility to satisfy constraints such as end-point position and tangents Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

9 Interpolation functions
Continuity within a curve Zero-order First order (tangential) Suffices for most animation applications Second order Important when dealing with time-distance curve Continuity between curve segments Hermite, Catmull-Rom, cubic Bezier provide first order continuity between segments Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

10 Interpolation functions
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

11 Continuity position (0th order) tangent (1st order) curvature
(2nd order) none At junction of two circular arcs Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

12 Interpolation functions
Global vs. local control Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

13 Types of Curve Representation
Explicit y = f(x) Good for generate points For each input, there is a unique output Implicit f(x,y) = 0 Good for testing if a point is on a curve Bad for generating a sequence of points Parametric x = f(u), y = g(u) Good for generating a sequence of points Can be used for multi-valued function of x Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

14 Example: Representing Unit Circle
Cannot be represented explicitly as a function of x Implicit form: f(x,y)=x2+y2=1 Parametric form: x=cos(u), y=sin(u), 0<u<2π f>0 f=0 f<0 u Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

15 More on 3-D Parametric Curves
Parametric form: P(u) = (Px(u), Py(u), Pz(u)) x = Px(u), y = Py(u), z = Pz(u) u=1/3 u=2/3 u=0.0 u=1.0 Space-curve P = P(u) <=u<=1.0 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

16 Polynomial Interpolation
An n-th degree polynomial fits a curve to n+1 points Example: fit a second degree curve to three points y(x)= a x2 + b x + c points to be interpolated (x1, y1), (x2, y2), (x3, y3) solve for coefficients (a, b, c): 3 linear equations, 3 unknowns called Lagrange Interpolation Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

17 Polynomial Interpolation (cont.)
Result is a curve that is too wiggly, change to any control point affects entire curve (nonlocal) – this method is poor We usually want the curve to be as smooth as possible minimize the wiggles high-degree polynomials are bad Higher degree, higher the wiggles Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

18 Composite Segments Divide a curve into multiple segments
Represent each in a parametric form Maintain continuity between segments position Tangent (C1-continuity vs. G1-continuity) curvature P1(u) P2(u) P3(u) Pn(u) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

19 Splines: Piecewise Polynomials
A spline is a piecewise polynomial - many low degree polynomials are used to interpolate (pass through) the control points Cubic polynomials are the most common lowest order polynomials that interpolate two points and allow the gradient at each point to be defined - C1 continuity is possible Higher or lower degrees are possible, of course Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

20 A Linear Piecewise Polynomial
The simple form for interpolating two points. p1 p2 u Each segment is of the form: (this is a vector equation) 1 u 1 Two basis (blending) functions Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

21 Hermite Interpolation
Hermite Curves—cubic polynomial for two points Hermite interpolation requires Endpoint positions derivatives at endpoints To create a composite curve, use the end of one as the beginning of the other and share the tangent vector control points/knots Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

22 Hermite Curve Formation
Cubic polynomial and its derivative Given Px(0), Px(1), P’x(0), P’x(1), solve for a, b, c, d 4 equations are given for 4 unknowns Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

23 Hermite Curve Formation (cont.)
Problem: solve for a, b, c, d Solution: Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

24 Hermite Curves in Matrix Form
ith segment in composite curves Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

25 Blending Functions of Hermite Splines
Each cubic Hermite spline is a linear combination of 4 blending functions geometric information Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

26 Composite Hermite Curve
Continuity between connected segments is ensured by using ending tangent vector of one segment as the beginning tangent vector of the next. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

27 Bezier Curves Similar to Hermite Curve
Instead of endpoints and tangents, four control points are given points P1 and P4 are on the curve points P2 and P3 are used to control the shape p1 = P1, p2 = P4, p1' = 3(P2-P1), p2' = 3(P4 - P3) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

28 Bezier Curves Another representation
Blend the control point position using Bernstein polynomials Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

29 Bezier Curves Animation(U), Chap 3, Interpolating Values
CS, NCTU, J. H. Chuang

30 Composite Bezier Curves
How to control the continuity between adjacent Bezier segment? Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

31 De Casteljau Construction of Bezier Curves
How to derive a point on a Bezier curve? Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

32 Bezier Curves (cont.) Variant of the Hermite spline
basis matrix derived from the Hermite basis (or from scratch) Gives more uniform control knobs (series of points) than Hermite Scale factor (3) is chosen to make “velocity” approximately constant Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

33 Catmull-Rom Splines With Hermite splines, the designer must arrange for consecutive tangents to be collinear, to get C1 continuity. Similar for Bezier. This gets tedious. Catmull-Rom: an interpolating cubic spline with built-in C1 continuity. Compared to Hermite/Bezier: fewer control points required, but less freedom. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

34 Catmull-Rom Splines (cont.)
Given n control points in 3-D: p1, p2, …, pn, Tangent at pi given by s(pi+1 – pi-1) for i=2..n-1, for some s. Curve between pi and pi+1 is determined by pi-1, pi, pi+1, pi+2. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

35 Catmull-Rom Splines (cont.)
Given n control points in 3-D: p1, p2, …, pn, Tangent at pi given by s(pi+1 – pi-1) for i=2..n-1, for some s Curve between pi and pi+1 is determined by pi-1, pi, pi+1, pi+2 What about endpoint tangents? (several good answers: extrapolate, or use extra control points p0, pn+1) Now we have positions and tangents at each knot – a Hermite specification. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

36 Catmull-Rom Spline Matrix
Derived similarly to Hermite and Bezier s is the tension parameter; typically s=1/2 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

37 Catmull-Rom Spline What about endpoint tangents? Provided by users
Several good answers: extrapolate, or use extra control points p0, pn+1 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

38 Catmull-Rom Spline Example Animation(U), Chap 3, Interpolating Values
CS, NCTU, J. H. Chuang

39 Catmull-Rom Spline Drawback
An internal tangent is not dependent on the position of the internal point relative to its two neighbors Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

40 p(0) = P2, p’(0) = s(P3-P1), p(1) = P3, p’(1) = s(P4-P2)
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

41 Splines and Other Interpolation Forms
See Computer Graphics textbooks Review Appendix B.4 in Parent Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

42 Now What? We have key frames or points
We have a way to specify the space curve Now we need to specify velocity to traverse the curve Speed Curves Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

43 Speed Control The speed of tracing a curve needs to be under the direct control of the animator Varying u at a constant rate will not necessarily generate P(u) at a constant speed. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

44 Non-uniformity in Parametrization
Generally, equally spaced samples in parameter space are not equally spaced along the curve B Time = 10 A Time = 0 C Time = 35 D Time = 60 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

45 Arc Length Reparameterization
To ensure a constant speed for the interpolated value, the curve has to be parameterized by arc length (for most applications) Computing arc length Analytic method (many curves do not have, e.g., B-splines) Numeric methods Table and differencing Gaussian quadrature Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

46 Arc Length Reparameterization
Space curve vs. time-distance function Relates time to the distance traveled along the curve, i.e., Relates time to the arc length along the curve Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

47 Arc Length Reparameterization
Given a space curve with arc length parameterization Allow movement along the curve at a constant speed by stepping at equal arc length intervals Allows acceleration and deceleration along the curve by controlling the distance traveled in a given time interval Problems Given a parametric curve and two parameter values u1 and u2, find arclength(u1,u2) Given an arc length s, and parameter value u1, find u2 such that arclength(u1,u2) = s Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

48 Arc Length Reparameterization
Converting a space curve P(u) to a curve with arc-length parameterization Find s=S(u), and u=S-1(s)=U(s) P*(s)=P(U(s)) Analytic arc-length parameterization is difficult or impossible for most curves, e.g., B-spline curve cannot be parameterized with arc length. Approximate arc-length parameterization Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

49 Forward Differencing Sample the curve at small intervals of the parameter Compute the distance between samples Build a table of arc length for the curve u Arc Length 0.0 0.00 0.1 0.08 0.2 0.19 0.3 0.32 0.4 0.45 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

50 Arc Length Reparameterization Using Forward Differencing
Given a parameter u, find the arc length Find the entry in the table closest to this u Or take the u before and after it and interpolate arc length linearly u Arc Length 0.0 0.00 0.1 0.08 0.2 0.19 0.3 0.32 0.4 0.45 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

51 Arc Length Reparameterization Using Forward Differencing
Given an arc length s and a parameter u1, find the parametric value u2 such that arclength(u1, u2)=s Find the entry in the table closest to this u using binary search Or take the u before and after it and interpolate linearly u Arc Length 0.0 0.00 0.1 0.08 0.2 0.19 0.3 0.32 0.4 0.45 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

52 Arc Length Reparameterization Using Forward Differencing
Easy to implement, intuitive, and fast Introduce errors Super-sampling in forming table 1000 equally spaced parameter values ebtries in each interval Better interpolation Adaptive forward differencing Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

53 Arc Length Reparameterization Using Adaptive forward differencing
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

54 Arc Length Reparameterization Using Numerical Integral
Arc length integral Simpson’s and trapezoidal integration using evenly spaced intervals Gaussian quadrature using unevenly spaced intervals Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

55 Speed Control Given a arc-length parameterized space curve, how to control the speed at which the curve is traced? By a speed-control functions that relate an equally spaced time interval to arc length Input time t, output arc length: s=S(t) Linear function: constant speed control Most common: ease-in/ease-out Smooth motion from stopped position, accelerate, reach a max velocity, and then decelerate to a stop position Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

56 Speed Control Function
Relates an equally spaced time interval to arc length Input time t, output arc length: s=S(t) Normalized arc length parameter s=ease(t) Start at 0, slowly increase in value and gain speed until the middle value and then decelerate as it approaches to 1. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

57 Constant Velocity Speed Curve
Moving at 1 m/s if meters and seconds are the units Too simple to be what we want Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

58 Distance Time Function and Speed Control
We have a space curve p=P(u) and a speed control function s=S(t). For a given t, s=S(t) Find the corresponding value u=U(s) by looking up an arc length table for a given s A point on the space curve with parameter u p=P(U(S(t))) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

59 Speed Control u* s* t* … u Arc Length 0.0 0.00 0.1 0.08 0.2 0.19 0.3
Arc Length Table u Arc Length 0.0 0.00 0.1 0.08 0.2 0.19 0.3 0.32 0.4 0.45 Speed Control Curve u* s* t* Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

60 Distance Time Function
Assumptions on distance time function The entire arc length of the curve is to be traversed during the given total time Additional optional assumptions The function should be monotonic in t The function should be continuous Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

61 Ease-in/Ease-out Most useful and most common ways to control motion along a curve (distance) Time Arc length Equally spaced samples in time specify arc length required for that frame Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

62 Ease-in/Ease-out Sine Interpolation
-1 1 -p/2 p/2 Arc Length Time Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

63 Ease-in/Ease-out Sine Interpolation
The speed of s w.r.t. t is never constant over an interval but rather is always accelerating or decelerating. Zero derivatives at t=0 and t=1 indicating smooth accelerating and deceleration at end points. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

64 Ease-in/Ease-out Piecing Curves Together for Ease In/Out
Arc Length Linear segment Time Sinusoidal segments Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

65 Ease-in/Ease-out Piecing Curves Together for Ease In/Out
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

66 Ease-in/Ease-out Integrating to avoid the sine function
acceleration time t1 t2 A D velocity time t1 t2 v Find v such that area = 1 arc length V1 = V2  A*t1 = - D*(1-t2) time Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

67 Ease-in/Ease-out Integrating to avoid the sine function
To avoid the transcendental function evaluation while providing a constant speed interval between ease-in and ease-out intervals Acceleration-time curve Velocity-time curve Velocity-time curve is defined by integral of the acceleration-time curve Distance-time curve is defined by integral of the velocity-time curve Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

68 Ease-in/Ease-out Integrating to avoid the sine function
In ease-in/ease-out function Velocity starts out at 0 and ends at 0 V1 = V2 inplies A*t1 = - D*(1-t2) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

69 Ease-in/Ease-out Integrating to avoid the sine function
Total distance = 1 implies 1 = ½ V0 t + V0 (t2-t1)+1/2 V0 (1-t2) Users specifies any two of three variables t1, t2, and V0, and the system can solve for the third Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

70 Ease-in/Ease-out Integrating to avoid the sine function
The result is Parabolic ease-in/ease-out More flexible than the sinusoidal ease-in/ease-out Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

71 Videos Bunny (Blue Sky Studios, 1998)
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

72 Review - Quaternions Similar to axis-angle representations
4-tuple of real numbers q=(s, x, y, z) or [s, v]s is a scalar; v is a vector The quaternion for rotating an angle about an axis (an axis-angle rotation): a=(ax, ay, az) Y q X If a is unit length, then q will be also Z Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

73 Review - Quaternions If a is unit length, then q will be also
Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

74 Review - Quaternions Rotating some angle around an axis is the same as rotating the negative angle around the negated axis Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

75 Review - Quaternion Math
Addition Multiplication Multiplication is associative but not commutative Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

76 Review - Quaternion Math (cont.)
Multiplicative identity: [1, 0,0,0] Inverse Normalization for unit quaternion Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

77 Review – Rotating Vectors Using Quaternion
A point in space, v, is represented as [0, v] To rotate a vector v using quaternion q Represent the vector as v = [0, v] Represent the rotation as a quaternion q Using quaternion multiplication The proof isn’t that hard Note that the result v’ always has zero scalar value Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

78 Review - Compose Rotations
Rotating a vector v by first quaternion p followed by a quaternion q is like rotation using qp Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

79 Review - Compose Rotations
To rotate a vector v by quaternion q followed by its inverse quaternion q-1 Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

80 Review - Quaternion Interpolation
A quaternion is a point on a 4D unit sphere Unit quaternion: q=(s,x,y,z), ||q|| = 1 Form a subspace: a 4D sphere Interpolating quaternion means moving between two points on the 4D unit sphere A unit quaternion at each step – another point on the 4D unit sphere Move with constant angular velocity along the greatest circle between the two points on the 4D unit sphere Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

81 Review - Linear Interpolation
Linear interpolation generates unequal spacing of points after projecting to circle Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

82 Review – Spherical Linear Interpolation (slerp)
Want equal increment along arc connecting two quaternion on the spherical surface Spherical linear interpolation (slerp) Normalize to regain unit quaternion Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

83 Review – Spherical Linear Interpolation (slerp)
Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

84 Review – Spherical Linear Interpolation (slerp)
Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

85 Review – Spherical Linear Interpolation (slerp)
Recall that q and –q represent same rotation What is the difference between: Slerp(u, q1, q2) and Slerp(u, q1, -q2) ? One of these will travel less than 90 degrees while the other will travel more than 90 degrees across the sphere This corresponds to rotating the ‘short way’ or the ‘long way’ Usually, we want to take the short way, so we negate one of them if their dot product is < 0 Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

86 Review – Spherical Linear Interpolation (slerp)
If we have an intermediate position q2, the interpolation from q1-->q2-->q3 will not necessarily follow the same path as the interpolation from q1 to q3. Animation(U), Chap 2, Tech. Background CS, NCTU, J. H. Chuang

87 Interpolating a Series of Quaternions
As linear interpolation in Euclidean space, we can have first order discontinuity problem when interpolating a series of orientations. Need a cubic curve interpolation to maintain first order continuity in Euclidean space Similarly, slerp can have 1st order discontinuity We also need a cubic curve interpolation in 4D spherical space for 1st order continuity Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

88 Interpolating a Series of Quaternions
Interpolated points […, pn-1, pn, pn+1, ….] in 3D Between each pair of points, two control points will be constructed. e.g., For pn an : the one intermediate after pn bn : the one immediately before pn pn+(pn-pn-1) Take average Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

89 Interpolating a Series of Quaternions
Interpolated points […, pn-1, pn, pn+1, ….] in 3D Between each pair of points, two control points will be constructed. e.g., For pn an : the one intermediate after pn bn : the one immediately before pn bn =pn+(pn-an) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

90 Interpolating a Series of Quaternions
Interpolated points […, pn-1, pn, pn+1, ….] in 3D End conditions Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

91 Interpolating a Series of Quaternions
Interpolated points […, pn-1, pn, pn+1, ….] in 3D Between any 2 interpolated points pn and pn+1, a cubic Bezier curve segment is defined by pn, an, bn+1, and pn+1 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

92 Interpolating a Series of Quaternions
How to evaluate a point on Bezier curve? De Casteljau Construction Constructing Bezier curve by multiple linear interpolation u=1/3 p(1/3) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

93 Interpolating a Series of Quaternions
Animation: See Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

94 Interpolating a Series of Quaternions
Bezier interpolation on 4D sphere? How are control points generated? How are cubic Beziers defined? Control points are automatically generated as it is not intuitive to manually adjust them on a 4D sphere Derive Bezier curve points by iteratively subdivision s on pn, an, bn+1, and pn+1 Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

95 Interpolating a Series of Quaternions Connecting Segments on 4D Sphere
Automatically generating interior (spherical) control points qn’ 2. Bisect the span an bn qn qn+1 qn-1 1. Double the arc Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

96 Interpolating a Series of Quaternions De Casteljau Construction on 4D Sphere
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

97 Path Following Issues about path following
Arc length parameterization and speed control Changing the orientation Smoothing a path Path along a surface Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

98 Orientation Along a Curve
A local coordinate system (u, v, w) is defined for an object to be animated Position along the path P(s), denoted as POS w-axis: the direction the object is facing v-axis: up vector u-axis: perpendicular to w and v (u, v, w): a right-handed coordinate system Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

99 Orientation Along a Curve
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

100 Orientation Along a Curve Frenet Frame
Frenet frame: a moving coordinate system determined by curve tangent and curvature Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

101 Orientation Along a Curve Frenet Frame
Problems No concept of “up” vector Is undefined in segments that has no curvature; i.e., P”(u)=0 Can be dealt with by interpolating a Frenet frame from the Frenet frames at segment’s boundary, which differ by only a rotation around w A discontinuity in the curvature vector Frenet frame has a discontinuous jump in orientation Resulting motions are usually too extreme and not natural looking Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

102 Orientation Along a Curve Frenet Frame
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

103 Orientation Along a Curve Frenet Frame
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

104 Orientation Along a Curve Camera Path Following
COI: center of interest A fixed point in the scene Center point of an object in the scene Points along the path itself Points on a separate path in the scene Points on the interpolation between points in the scene Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

105 Smoothing a Path with Linear Interpolation
Two points on either sides of a point are averaged, and this point is averaged with the original point. Repeated application Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

106 Smoothing a Path with Linear Interpolation
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

107 Smoothing a Path with Cubic Interpolation
Four points on either sides of a point are fitted by a cubic curve, and the midpoint of the curve is averaged with the original point. Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

108 Smoothing a Path with Cubic Interpolation
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

109 Smoothing a Path with Cubic Interpolation
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

110 Determine a Path on a Surface
If one object is to move across the surface of another object, we need to specify a path across the surface. Given start and destination points Find a shortest path between the points – expensive Determine a plane that contain two points and is generally perpendicular to the surface (averaged normal of two points) Intersection of the plane with the surface (mesh) Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

111 Determine a Path on a Surface
Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang

112 Determine a Path on a Parametric Surface
Given start and destination points on parametric domain Define the straight line connecting two points in the parametric space The curve on the surface corresponding to this line Animation(U), Chap 3, Interpolating Values CS, NCTU, J. H. Chuang


Download ppt "Chap 3 Interpolating Values"

Similar presentations


Ads by Google