hermite curves
play

Hermite Curves CS 418 Interactive Computer Graphics John C. Hart - PowerPoint PPT Presentation

Hermite Curves CS 418 Interactive Computer Graphics John C. Hart Linear Interpolation Define a parametric function p ( t ) p (0) = p 0 , p (1) = p 1 p 1 =( x 1 , y 1 ) y p 0 =( x 0 , y 0 ) x Linear Interpolation Define a parametric


  1. Hermite Curves CS 418 Interactive Computer Graphics John C. Hart

  2. Linear Interpolation • Define a parametric function p ( t ) p (0) = p 0 , p (1) = p 1 p 1 =( x 1 , y 1 ) y p 0 =( x 0 , y 0 ) x

  3. Linear Interpolation • Define a parametric function p ( t ) p (0) = p 0 , p (1) = p 1 p 1 =( x 1 , y 1 ) • Separate into coordinate functions p ( t ) = ( x ( t ), y ( t )) y x (0) = x 0 y (0) = y 0 , x (1) = x 1 y (1) = y 1 p 0 =( x 0 , y 0 ) x y x t t

  4. Linear Interpolation • Define a parametric function p ( t ) p (0) = p 0 , p (1) = p 1 p 1 =( x 1 , y 1 ) • Interpolate p ( t ) = p 0 + t ( p 1 – p 0 ) = (1- t ) p 0 + t p 1 y x ( t ) = x 0 + t ( x 1 – x 0 ) = (1- t ) x 0 + t x 1 y ( t ) = y 0 + t ( y 1 – y 0 ) = (1- t ) y 0 + t y 1 p 0 =( x 0 , y 0 ) x y x t t

  5. Hermite Interpolation • From point p 0 along p ’ 0 to point p 1 toward p ’ 1 p 1 =( x 1 , y 1 ) y p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) x

  6. Hermite Interpolation • From point p 0 along p ’ 0 to point p 1 toward p ’ 1 p 1 =( x 1 , y 1 ) • Define a parametric function p ( t ) p (0) = p 0 , p (1) = p 1 y p’ (0) = p ’ 0 , p’ (1) = p ’ 1 p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) x

  7. Hermite Interpolation • Define a parametric function p ( t ) p (0) = p 0 , p (1) = p 1 p 1 =( x 1 , y 1 ) p’ (0) = p ’ 0 , p’ (1) = p ’ 1 • Separate into coordinate y functions x (0) = x 0 , x (1) = x 1 x ’(0) = x ’ 0 , x ’(1) = x ’ 1 p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) x x y t t

  8. Hermite Interpolation • Separate into coordinate functions x (0) = x 0 , x (1) = x 1 x ’(0) = x ’ 0 , x ’(1) = x ’ 1 x t

  9. Hermite Interpolation • Separate into coordinate functions x (0) = x 0 , x (1) = x 1 x ’(0) = x ’ 0 , x ’(1) = x ’ 1 • Need cubic function x x ( t ) = At 3 + Bt 2 + Ct + D x ’( t ) = 3 At 2 + 2 Bt + C t

  10. Hermite Interpolation • Separate into coordinate functions x (0) = x 0 , x (1) = x 1 x ’(0) = x ’ 0 , x ’(1) = x ’ 1 • Need cubic function x x ( t ) = At 3 + Bt 2 + Ct + D x ’( t ) = 3 At 2 + 2 Bt + C • Solve A = 2 x 0 – 2 x 1 + x ’ 0 + x ’ 1 B = -3 x 0 + 3 x 1 – 2 x ’ 0 – x ’ 1 t C = x ’ 0 D = x 0

  11. Hermite Interpolation t 3 + p ( t ) = (2 p 0 – 2 p 1 + p ’ 0 + p ’ 1 ) t 2 + (-3 p 0 + 3 p 1 – 2 p ’ 0 – p ’ 1 ) p 1 =( x 1 , y 1 ) p ’ 0 t + p 0 (1) y p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) x

  12. Hermite Interpolation p 1 =( x 1 , y 1 ) y t 3 + p ( t ) = (2 p 0 – 2 p 1 + p ’ 0 + p ’ 1 ) t 2 + (-3 p 0 + 3 p 1 – 2 p ’ 0 – p ’ 1 ) p ’ 0 t + p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) p 0 (1) x −     p 2 2 1 1 0     − − − p 3 3 2 1       1 =  3 2 p ( ) 1 t t t t      p ' 0 0 1 0 0         p ' 1 0 0 0 1

  13. Hermite Interpolation p 1 =( x 1 , y 1 ) y t 3 + p ( t ) = (2 p 0 – 2 p 1 + p ’ 0 + p ’ 1 ) t 2 + (-3 p 0 + 3 p 1 – 2 p ’ 0 – p ’ 1 ) p ’ 0 t + p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) p 0 (1) x −     p 2 2 1 1 0     − − − p 3 3 2 1       1 =  3 2 p ( ) 1 t t t t      p ' 0 0 1 0 0         p ' 1 0 0 0 1 (2 t 3 – 3 t 2 + 1) p 0 + p (t) = (-2 t 3 + 3 t 2 ) p 1 + ( t 3 – 2 t 2 + t ) p ’ 0 + ( t 3 – t 2 ) p ’ 1

  14. Hermite Interpolation p 1 =( x 1 , y 1 ) y t 3 + p ( t ) = (2 p 0 – 2 p 1 + p ’ 0 + p ’ 1 ) t 2 + (-3 p 0 + 3 p 1 – 2 p ’ 0 – p ’ 1 ) p ’ 0 t + p ’ 0 =( x ’ 0 , y ’ 0 ) p 0 =( x 0 , y 0 ) p 0 (1) x 1 1 −     p 2 2 1 1 0     − − − p 0 p 1 p 3 3 2 1       1 =  3 2 p ( ) 1 t t t t      p ' 0 0 1 0 0     0 0     p ' 1 0 0 0 t t 1 p’ 0 p’ 1 (2 t 3 – 3 t 2 + 1) p 0 + p (t) = (-2 t 3 + 3 t 2 ) p 1 + 0 0 ( t 3 – 2 t 2 + t ) p ’ 0 + ( t 3 – t 2 ) p ’ 1 t t

Recommend


More recommend