19 Interpolation and splines How are smooth surfaces drawn (when - - PowerPoint PPT Presentation

19 interpolation and splines
SMART_READER_LITE
LIVE PREVIEW

19 Interpolation and splines How are smooth surfaces drawn (when - - PowerPoint PPT Presentation

19 INTERPOLATION AND SPLINES 19 Interpolation and splines How are smooth surfaces drawn (when polygonal approximation fails)? Aim: understand principles of interpolation and extrapolation. Reading: Foley Sections 9.2 Parametric


slide-1
SLIDE 1

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪

19 Interpolation and splines

How are smooth surfaces drawn (when polygonal approximation fails)? Aim: understand principles of interpolation and extrapolation. Reading:

  • Foley Sections 9.2 Parametric bubic curves, 9.2.1 Basic characteristics, 9.2.3

B´ ezier curves, 9.3 Parametric bicubic surfaces, 9.3.1 Hermite surfaces, 9.3.2 B´ ezier surfaces and 9.3.4 Normals to surfaces, 9.4 Quadric surfaces. Further reading:

  • Heath’s lecture 7 on interpolation, (see

http://www.cse.uiuc.edu/heath/scicomp/notes/) from Scientific Computing: An Introductory Survey, Second Edition by Michael T. Heath, McGraw-Hill 2002; ISBN 0-07-239910-4.

278

slide-2
SLIDE 2

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ Introduction to interpolation

Say know value of a function f(x) at a set of points x1, x2, . . . , xn

(x1 < x2 < . . . < xn) but f(x) not known in analytic form.

i.e. don’t know equation for f(x). e.g. may get f(xi) values from a physical measurement in an experiment, or from a long, complicated calculation.

279

slide-3
SLIDE 3

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪

How do we estimate f(x) for arbitrary x? If desired x within range of xi then use interpolation If desired x outside range of xi then use extrapolation

5 10 15 20 25 30 35 40 45 50 2 4 6 8 10 12

x1 Interpolation

280

slide-4
SLIDE 4

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪

Most common functional form used are polynomials. Also use

  • rational functions (quotients of polynomials) and
  • trigonometric functions (sines, cosines etc.)
  • as well as others, e.g. ax2+bx+c

dx+c

281

slide-5
SLIDE 5

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪

1 2 1 1 2 x(t) x(t) t t y(t) y(t) 1

Two joined 2D parametric curve segments (Foley Figure 9.7).

282

slide-6
SLIDE 6

19– INTERPOLATION AND SPLINES

Parametric curve x(t) = axt3 + bxt2 + cxt + dx y(t) = ayt3 + byt2 + cyt + dy z(t) = azt3 + bzt2 + cxt + dz

where 0 ≤ t ≤ 1

C = ⎡ ⎣ ax bx cx dx ay by cy dy az bz cz dz ⎤ ⎦

Can rewrite parametric curve as

Q(t) =

  • x(t)

y(t) z(t) T = C · T

282-2

slide-7
SLIDE 7

19– INTERPOLATION AND SPLINES

Tangent vectors

The derivative of Q(t) is the parametric tangent vector of the curve.

x(t) = axt3 + bxt2 + cxt + dx y(t) = ayt3 + byt2 + cyt + dy z(t) = azt3 + bzt2 + cxt + dz

where 0 ≤ t ≤ 1

d dtQ(t) = Q′(t) =

d

dtx(t) d dty(t) d dtz(t)

T = d

dtC · T = C ·

  • 3t2

2t 1 T = 3axt2 + 2bxt + cx 3ayt2 + 2byt + cy 3azt2 + 2bzt + cz T

282-3

slide-8
SLIDE 8

19– INTERPOLATION AND SPLINES

Parametric continuity

If the direction and magnitutde of the

dn dtn

Q(t)

through the nth derivative are equal at the join point, the curve is called cn continuous. 282-4

slide-9
SLIDE 9

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪

y(t ) x(t ) S C1 C0 C2 Join point

y(t) x(t) P1 P2 Q3 P3 Q2 Q1 TV2 TV3

Left: Curve segment S joined to segments C0, C1 and C2. Right: Curve segments Q1, Q2 and Q3 join at the point P2 and are identical except for their tangent vectors at P2 (Foley Figures 9.8 and 9.9).

283

slide-10
SLIDE 10

19– INTERPOLATION AND SPLINES

B´ ezier curves

B´ ezier curves are defined by the starting and ending vectors of a curve,

P1P2 and P3P4

and are therefore determined by four control points. 283-3

slide-11
SLIDE 11

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ 19.1 B´ ezier curves

P4 P1 P3 P2 P2 P4 P1 P3

Two B´ ezier curves and their control points (Foley Figure 9.15).

284

slide-12
SLIDE 12

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ 19.2 B-Splines

The term spline relates to strips of metal used by draftsmen to lay out surfaces in aeroplanes, cars and ships. These metal splines had second-order continuity. The mathematical equivalent of these are C 0, C1, and C2 continuous cubic polynomial that interpolates (passes through) the control points. Splines have one more degree of continuity that B ´ ezier forms, thus splines are smoother.

285

slide-13
SLIDE 13

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ 19.3 Uniform nonrational B-splines

y(t) P9 P3 P1 P8 P4 P7 P6 P5 P2 P0 Q9 Q8 Q7 Q6 Q5 Q4 Q3 t3 t5 t6 t7 t4 t8 t9 t10 Knot Control point x(t) (Foley Figure 9.18)

286

slide-14
SLIDE 14

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪

y(t) P3 P1 P8 P4 P7 P6 P5 P2 P0 Q8 Q7 Q6 Q5 Q4 Q3 Knot Control point x(t) P'4 P''4 P''4Curve P'4 Curve Curve P4

Moving control point P4 to different positions (Foley Figure 9.19).

287

slide-15
SLIDE 15

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ 19.4 Parametric bicubic surfaces

P41 P42 P31 P21 P11 P12 P22 P32 P43 P13 P23 P33 P44 P14 P24 P34

Sixteen control points of a B´ ezier bicubic surface (Foley Figure 9.24).

288

slide-16
SLIDE 16

19– INTERPOLATION AND SPLINES

19.5 Parametric bicubic surfaces

P16 P15 P14 P25 Common edge P41 P31 P21 P42 P32 P22 P11 P12 P13 P23 P33 P43 P34 P24 P44 P35 P45 P36 P26 P27 P37 P46 P47 P17

(Foley Figure 9.25). 288-1

slide-17
SLIDE 17

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ 19.6 Computing parametric curves and surfaces

Despite the computational complexity involved in rendering Parametric curves and surfaces (see Foley Section 9.3.5 Displaying bicubic surfaces) they clearly have benefits, including

  • the production of very high resolution, photo-realistic images for visualising

designs (in the automotive industry bicubic splines have been extensively used for visualising new body shapes).

  • the production of high-tolerance surfaces with very few errors or artifacts (useful

for the design of industrial components such as engine parts). Although many of these applications are presently limited either expensive hardware accelerators and/or batch processing before the final results are ready to visualise.

289

slide-18
SLIDE 18

19– INTERPOLATION AND SPLINES

✬ ✫ ✩ ✪ 19.7 Parametric in real-time graphics?

What kinds of real-time rendering and shading applications can you think of that might benefit from parametric surfaces? What kinds of parametric surfaces do you think might be good candidates for real-time computer graphics why? What advantages might a parametric approach have over a polygonal approach to modelling surfaces in animation?

290