Presentation is loading. Please wait.

Presentation is loading. Please wait.

Curves and Surfaces.

Similar presentations


Presentation on theme: "Curves and Surfaces."— Presentation transcript:

1 Curves and Surfaces

2 Limitations of Polygonal Meshes
planar facets

3 Some Non-Polygonal Modeling Tools
Extrusion Surface of Revolution Spline Surfaces/Patches Quadrics and other implicit polynomials

4 Continuity definitions:
C0 continuous curve/surface has no breaks/gaps/holes "watertight" C1 continuous curve/surface derivative is continuous "looks smooth, no facets" C2 continuous curve/surface 2nd derivative is continuous Actually important for shading

5 Splines... Classic problem: How to draw smooth curves?
Spline curve: smooth curve that is defined by a sequence of points Requirements: H&B 8-8:

6 Splines 1 Spline curve: smooth curve that is defined by a
sequence of points Approximating spline Interpolating spline H&B 8-8:

7 Splines 2 Convex hull: Smallest polygon that encloses all points
Approximating spline Interpolating spline H&B 8-8:

8 Splines 3 Control graph: polyline through sequence of points
Approximating spline Interpolating spline H&B 8-8:

9 Splines 4 Splines in computer graphics: Piecewise cubic splines
Segments H&B 8-8:

10 Splines 5 Segments have to match ‘nicely’.
Given two segments P(u) en Q(v). We consider the transition of P(1) to Q(0). Zero-order parametric continuity C0: P(1) = Q(0). Endpoint of P(u) coincides with startpoint Q(v). P(u) Q(v) H&B 8-8:

11 Splines 6 Segments have to match ‘nicely’.
Given two segments P(u) en Q(v). We consider the transition of P(1) to Q(0). First order parametric continuity C1: dP(1)/du = dQ(0)/dv. Direction of P(1) coincides with direction of Q(0). P(u) Q(v) H&B 8-8:

12 Splines 7 First order parametric continuity gives a smooth
curve. Sometimes good enough, sometimes not. line segment circle arc Suppose that you are bicycling over the curve. What to do with the steering rod at the transition? Turn around! Discontinuity in the curvature! H&B 8-8:

13 Splines 8 Given two segments P(u) and Q(v).
We consider the transition of P(1) to Q(0). Second order parametric continuity C2: d2P(1)/du2 = d2Q(0)/dv2. Curvatures in P(1) and Q(0) are equal. P(u) Q(v) H&B 8-8:

14 Splines 9 So far: considered parametric continuity.
Here the vectors are exactly equal. It suffices to require that the directions are the same: geometric continuity. Q(v) P(u) Q(v) P(u) H&B 8-8:

15 Splines 10 Given two segments P(u) en Q(v).
We consider the transition of P(1) to Q(0). First order geometric continuity: G1: dP(1)/du =  dQ(0)/dv with  >0. Direction of P(1) coincides with direction Q(0). P(u) Q(v) H&B 8-8:

16 Representation cubic spline 1
H&B 8-8: U: Powers of u C: Coefficient matrix

17 Representation cubic spline 2
Control points or Control vectors H&B 8-8: Matrix Mspline :’translates’ geometric info to coefficients

18 Representation cubic spline 3
H&B 8-8:

19 Representation cubic spline 4
H&B 8-8:

20 Representatie cubic spline 5
Puzzle: Describe a line segment between the points P0 en P1 with those three variants. P1 u=1 P0 u u=0 H&B 8-8:

21 Representation cubic spline 6
H&B 8-8:

22 Representation cubic spline 7
H&B 8-8:

23 Representation cubic spline 8
H&B 8-8:

24 Spline surface 1 P33 P03 P30 P20 P10 H&B 8-8: P00

25 Spline surface 2 H&B 8-8:

26 Spline surface 2 P33 P03 P30 P20 P10 H&B 8-8: P00

27 Spline surface 3 v u H&B 8-8:

28 Spline surface 4 v du := 1/nu; // nu: #facets u-direction u
dv := 1/nv; // nv: #facets v-direction for i := 0 to nu1 do u := i*du; for j := 0 to nv  1 do v := j*dv; DrawQuad(P(u,v), P(u+du, v), P(u+du, v+dv), P(u, v+dv)) u H&B 8-8:

29 Spline surface 5 // Alternative: calculate points first
for i := 0 to nu do for j := 0 to nv do Q[i, j] := P(i/nu, j/nv); for i := 0 to nu  1 do for j := 0 to nv  1 do DrawQuad(Q[i, j], Q[i+1, j], Q[i+1, j+1], Q[i, j+1]) v u H&B 8-8:

30 Spline surface 6 // Alternative: calculate points first,
// triangle version for i := 0 to nu do for j := 0 to nv do Q[i, j] := P(i/nu, j/nv); for i := 0 to nu  1 do for j := 0 to nv  1 do DrawTriangle(Q[i, j], Q[i+1, j], Q[i+1, j+1]); DrawTriangle(Q[i, j], Q[i+1, j+1], Q[i, j+1]); v u H&B 8-8:

31 Spline surface 7 // Alternative: calculate points first,
// triangle variant, triangle strip for i := 0 to nu do for j := 0 to nv do Q[i, j] := P(i/nu, j/nv); for i := 0 to nu  1 do glBegin(GL_TRIANGLE_STRIP); for j := 0 to nv  1 do glVertex(Q[i, j]); glVertex(Q[i, j+1]); glEnd; v u H&B 8-8:

32 Bézier spline curves 1 H&B 8-10:

33 Bézier spline curves 2 P1 P0 H&B 8-10:

34 Bézier spline curves 3 P1 P2 P0 H&B 8-10:

35 Bézier spline curves 4 P2 P3 P1 P0 H&B 8-10:

36 Bézier spline curves 5 P2 P3 P1 P0 H&B 8-10:

37 Bézier spline curves 6 P2 P3 P1 P0 H&B 8-10:

38 Bézier spline curves 7 P2 P3 P1 P0 H&B 8-10:

39 Bézier spline curves 8 P2 P3 Q1 P1 Q0 Q2 Q3 P0 H&B 8-10:

40 Bézier spline curves 8 P2 P3 Q1 P1 Q0 Q2 Q3 P0 H&B 8-10:

41 Bézier spline curves 9 P2 P3 Q1 P1 Q0 Q2 Q3 P0 H&B 8-10:

42 Bézier spline curves 9 P2 P3 P1 Q1 Q0 Q2 Q3 P0 H&B 8-10:

43 Bézier spline curves 10 H&B 8-10:

44 Bézier surface 1 P33 P03 P30 P20 P10 P00 H&B 8-10:

45 Bézier surface 2 P33 P30 Q33 P03 P00 Q30 Q03 H&B 8-10: Q00

46 Bézier surface 2 P33 P30 Q33 P03 P00 Q03 Q30 H&B 8-10: Q00

47 Bézier surface 3 P33 P30 P03 P00 Q30 H&B 8-10: Q00

48 Bézier surface 3 P33 P30 P03 P00 Q30 H&B 8-10: Q00

49 Bézier surface 3 P33 P30 P03 P00 Q30 H&B 8-10: Q00


Download ppt "Curves and Surfaces."

Similar presentations


Ads by Google