Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values.

Similar presentations


Presentation on theme: "Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values."— Presentation transcript:

1 Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values

2 Computer Animation Rick Parent Animation Animator specified interpolation key frame Algorithmically controlled Physics-based Behavioral Data-driven motion capture

3 Computer Animation Rick Parent Motivation Common problem: given a set of points Smoothly (in time and space) move an object through the set of points Example additional temporal constraints: From zero velocity at first point, smoothly accelerate until time t1, hold a constant velocity until time t2, then smoothly decelerate to a stop at the last point at time t3

4 Computer Animation Rick Parent Motivation – solution steps 1. Construct a space curve that interpolates the given points with piecewise first order continuity 2. Construct an arc-length-parametric- value function for the curve 3. Construct time-arc-length function according to given constraints p=P(u) u=U(s) s=S(t) p=P(U(S(t)))

5 Computer Animation Rick Parent Interpolating function Interpolation v. approximation Complexity: cubic Continuity: first degree (tangential) Local v. global control: local Information requirements: tangents needed?

6 Computer Animation Rick Parent Interpolation v. Approximation

7 Computer Animation Rick Parent Complexity Low complexity reduced computational cost CUBIC polynomial Point of Inflection Can match arbitrary tangents at end points

8 Computer Animation Rick Parent Continuity

9 Computer Animation Rick Parent Local v. Global Control

10 Computer Animation Rick Parent Information requirements just the points tangents interior control points just beginning and ending tangents

11 Computer Animation Rick Parent Curve Formulations Piecewise cubic polynomials Hermite Catmull-Rom Blended Parabolas Bezier B-spline Tension-Continuity-Bias 4-Point Form Lagrange Polynomial

12 Computer Animation Rick Parent Lagrange Polynomial

13 Computer Animation Rick Parent Polynomial Curve Formulations Need to match real-world data v. design from scratch Information requirements: just points? tangents? Qualities of final curve? Intuitive enough? Other shape controls? Geometric information Coefficient matrix Blending Functions Algebraic coefficient matrix

14 Computer Animation Rick Parent Hermite

15 Computer Animation Rick Parent Cubic Bezier Interior control points play the same role as the tangents of the Hermite formulation

16 Computer Animation Rick Parent Blended Parabolas/Catmull-Rom* * End conditions are handled differently

17 Computer Animation Rick Parent Controlling Motion along p=P(u) Step 2. Reparameterization by arc length Step 3. Speed control u = U(s) where s is distance along the curve s = ease(t) where t is time for example, ease-in / ease-out

18 Computer Animation Rick Parent Reparameterizing by Arc Length Analytic Forward differencing Supersampling Adaptive approach Numerically Adaptive Gaussian

19 Computer Animation Rick Parent Reparameterizing by Arc Length - analytic Can’t always be solved analytically for our curves

20 Computer Animation Rick Parent Reparameterizing by Arc Length - supersample 1.Calculate a bunch of points at small increments in u 2.Compute summed linear distances as approximation to arc length 3.Build table of (parametric value, arc length) pairs Notes 1.Often useful to normalize total distance to 1.0 2.Often useful to normalize parametric value for multi-segment curve to 1.0

21 Computer Animation Rick Parent indexuArc Length 00.000.000 10.050.080 20.100.150 30.150.230... 201.001.000 Build table of approx. lengths

22 Computer Animation Rick Parent Adaptive Approach How fine to sample? Compare successive approximations and see if they agree within some tolerance Test can fail – subdivide to predefined level, then start testing

23 Computer Animation Rick Parent Reparameterizing by Arc Length - quadrature Lookup tables of weights and parametric values Can also take adaptive approach here

24 Computer Animation Rick Parent Reparameterizing by Arc Length Analytic Forward differencing Supersampling Adaptive approach Numerically Adaptive Gaussian Sufficient for many problems

25 Computer Animation Rick Parent Speed Control Time-distance function Ease-in Cubic polynomial Sinusoidal segment Segmented sinusoidal Constant acceleration General distance-time functions time distance

26 Computer Animation Rick Parent Time Distance Function s = S(t) s t S

27 Computer Animation Rick Parent Ease-in/Ease-out Function s = S(t) s t S 0.0 1.0 Normalize distance and time to 1.0 to facilitate reuse

28 Computer Animation Rick Parent Ease-in: Sinusoidal

29 Computer Animation Rick Parent Ease-in: Piecewise Sinusoidal

30 Computer Animation Rick Parent Ease-in: Piecewise Sinusoidal Provides linear (constant velocity) middle segment

31 Computer Animation Rick Parent Ease-in: Single Cubic

32 Computer Animation Rick Parent Ease-in: Constant Acceleration

33 Computer Animation Rick Parent Ease-in: Constant Acceleration

34 Computer Animation Rick Parent Ease-in: Constant Acceleration

35 Computer Animation Rick Parent Ease-in: Constant Acceleration

36 Computer Animation Rick Parent Arbitrary Speed Control Animators can work in: Distance-time space curves Velocity-time space curves Acceleration-time space curves Set time-distance constraints etc.

37 Computer Animation Rick Parent Curve fitting to distance-time pairs

38 Computer Animation Rick Parent Working with time-distance curves

39 Computer Animation Rick Parent Interpolating distance-time pairs

40 Computer Animation Rick Parent Frenet Frame – control orientation

41 Computer Animation Rick Parent Frenet Frame tangent & curvature vector

42 Computer Animation Rick Parent Frenet Frame tangent & curvature vector

43 Computer Animation Rick Parent Frenet Frame tangent & curvature vector

44 Computer Animation Rick Parent Frenet Frame local coordinate system Directly control orientation of object/camera Use for direction and bank into turn, especially for ground-planar curves (e.g. roads)

45 Computer Animation Rick Parent Frenet Frame - undefined

46 Computer Animation Rick Parent Frenet Frame - discontinuity

47 Computer Animation Rick Parent Other ways to control orientation Use point P(s+ds) for direction Use auxiliary curve to define direction or up vector

48 Computer Animation Rick Parent Direction & Up vector Direction vector w u=w x y-axis v = u x w To keep ‘head up’, use y-axis to compute over and up vectors perpendicular to direction vector If up vector supplied, use instead of y-axis

49 Computer Animation Rick Parent Orientation interpolation Preliminary note: 1. Remember that 2. Affects of scale are divided out by the inverse appearing in quaternion rotation 3.When interpolating quaternions, use UNIT quaternions – otherwise magnitudes can interfere with spacing of results of interpolation

50 Computer Animation Rick Parent Orientation interpolation 2 problems analogous to issues when interpolating positions: 1. How to take equi-distant steps along orientation path? 2. How to pass through orientations smoothly (1 st order continuous) Quaternions can be interpolated to produce in-between orientations: 3. And another particular to quaternions: with dual unit quaternion representations, which to use?

51 Computer Animation Rick Parent Dual representation Dual unit quaternion representations For Interpolation between q1 and q2, compute cosine between q1 and q2 and between q1 and –q2; choose smallest angle

52 Computer Animation Rick Parent Interpolating quaternions Linearly interpolating unit quaternions: not equally spaced Unit quaternions form set of points on 4D sphere

53 Computer Animation Rick Parent Interpolating quaternions in great arc => equal spacing

54 Computer Animation Rick Parent Interpolating quaternions ‘slerp’, sphereical linear interpolation is a function of the beginning quaternion orientation, q1 the ending quaternion orientation, q2 the interpolant, u where

55 Computer Animation Rick Parent Smooth Orientation interpolation Use quaternions Interpolate along great arc (in 4-space) using cubic Bezier on sphere 1. Select representation to use from duals 2. Construct interior control points for cubic Bezier 3. use DeCastelajue construction of cubic Bezier

56 Computer Animation Rick Parent Smooth quaternion interpolation How to smoothly interpolate through orientations q 1, q 2, q 3,…q n Similar to first order continuity desires with positional interpolation Bezier interpolation – geometric construction

57 Computer Animation Rick Parent Bezier interpolation

58 Computer Animation Rick Parent Bezier interpolation Construct interior control points p n-1 pnpn p n+1 p n+2 anan tntn p n-1 pnpn p n+1 p n+2 anan bnbn p n-1 pnpn p n+1 p n+2 anan t n+1 a n+1 b n+1 p2p2 p1p1 p0p0 a0a0

59 Computer Animation Rick Parent Quaternion operators Similar to forming a vector between 2 points, form the rotation between 2 orientations Given 2 orientations, form result of applying rotation between the two to 2 nd orientation q1q1 q2q2 q1q1 q2q2 qdqd double(q 1, q 2 ) bisect(q 1, q 2 ) qbqb

60 Computer Animation Rick Parent Quaternion operators Bisect 2 orientations: p q

61 Computer Animation Rick Parent Bezier interpolation Need quaternion-friendly operators to form interior control points

62 Computer Animation Rick Parent Bezier interpolation Construct interior control points Bezier segment: q n, a n, b n+1, q n+1 p n-1 pnpn p n+1 p n+2 anan tntn p n-1 pnpn p n+1 p n+2 anan bnbn p n-1 pnpn p n+1 p n+2 anan t n+1 a n+1 b n+1

63 Computer Animation Rick Parent Bezier construction using quaternion operators Need quaternion-friendly operations to interpolate cubic Bezier curve using ‘quaternion’ points de Casteljau geometric construction algorithm

64 Computer Animation Rick Parent Bezier construction using quaternion operators t 1 =slerp(q n, a n,1/3) t 2 =slerp(a n, b n+1,1/3) t 3 =slerp(b n+1, q n+1,1/3) t 12 =slerp(t 1, t 2,1/3) t 23 =slerp(t 12, t 23,1/3) q=slerp(t 12, t 23,1/3)

65 Computer Animation Rick Parent Working with paths Smoothing a path Determining a path along a surface Finding downhill direction

66 Computer Animation Rick Parent Smoothing data

67 Computer Animation Rick Parent Smoothing data

68 Computer Animation Rick Parent Smoothing data

69 Computer Animation Rick Parent Smoothing data

70 Computer Animation Rick Parent Smoothing data

71 Computer Animation Rick Parent Smoothing data

72 Computer Animation Rick Parent Smoothing data

73 Computer Animation Rick Parent Smoothing data

74 Computer Animation Rick Parent Smoothing data

75 Computer Animation Rick Parent Smoothing data

76 Computer Animation Rick Parent Smoothing data

77 Computer Animation Rick Parent Smoothing data

78 Computer Animation Rick Parent Path finding

79 Computer Animation Rick Parent Path finding - downhill


Download ppt "Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values."

Similar presentations


Ads by Google