Presentation is loading. Please wait.

Presentation is loading. Please wait.

1. 2 The use of curved surfaces allows for a higher level of modeling, especially for the construction of highly realistic models. There are several approaches.

Similar presentations


Presentation on theme: "1. 2 The use of curved surfaces allows for a higher level of modeling, especially for the construction of highly realistic models. There are several approaches."— Presentation transcript:

1 1

2 2 The use of curved surfaces allows for a higher level of modeling, especially for the construction of highly realistic models. There are several approaches to modeling curved surfaces: (1) Similar to polyhedral models, we model an object by using small curved surface patches (instead of polygons) placed next to each other. (2) Another approach is solid modeling, that constructs a model using elementary solid objects (such as: polyhedra, spheres, cones etc.) as building blocks. Curved Surfaces

3 3 There are two ways to construct a model: This is the process of building the model by assembling many simpler objects. For example, creating a (cylindrical) hole in a sphere or a cube. Additive Modeling This is the process of removing pieces from a given object to create a new object. Subtractive Modeling Curved Surfaces We can represent curved surfaces using mesh of curves. So we learn to create curves first then move to curved surfaces. Curved Surface Patch

4 4 Curve Representation There are three ways to represent a curve Explicit: y = f(x) y = mx + by = x 2 (–) Must be a single valued function (–) Vertical lines, say x = d? Implicit: f(x,y) = 0 x 2 + y 2 - r 2 = 0 (+) y can be multiple valued function of x (–) Vertical lines? Parametric: (x, y) = (x(t), y(t)) (x, y) = (cost, sint) (+) Easy to specify, modify and control (–) Extra hidden variable t, the parameter

5 5 Explicit Representation Curve in 2D: y = f(x) Curve in 3D: y = f(x), z = g(x) Surface in 3D: z = f(x,y) Problems: How about a vertical line x = c as y = f(x)? Circle y =  (r 2 – x 2 ) 1/2 two or zero values for x Rarely used in computer graphics

6 6 Implicit Representation Curve in 2D: f(x,y) = 0 Line: ax + by + c = 0 Circle: x 2 + y 2 – r 2 = 0 Surface in 3d: f(x,y,z) = 0 Plane: ax + by + cz + d = 0 Sphere: x 2 + y 2 + z 2 – r 2 = 0 f(x,y,z) can describe 3D object: Inside: f(x,y,z) < 0 Surface: f(x,y,z) = 0 Outside: f(x,y,z) > 0

7 7 Parametric Form for Curves Curves: single parameter u (e.g. time) x = x(t), y = y(t), z = z(t) Circle: x = cos(t), y = sin(t), z = 0 Tangent described by derivative Magnitude is “velocity”

8 8 Parametric Form for Surfaces Use parameters u and v x = x(u,v), y = y(u,v), z = z(u,v) Describes surface as both u and v vary Partial derivatives describe tangent plane at each point p(u,v) = [x(u,v) y(u,v) z(u,v)] T

9 9 Advantages of Parametric Form Parameters often have natural meaning Easy to define and calculate Tangent and normal Curves segments (for example, 0  u  1) Surface patches (for example, 0  u,v  1)

10 10 Lagrange Polynomial Problems: y=f(x), no multiple values Higher order functions tend to oscillate No local control (change any (x i, y i ) changes the whole curve) Computationally expensive due to high degree. Given n+1 points (x 0, y 0 ), (x 1, y 1 ) …….. (x n, y n ) To construct a curve that passes through these points we can use Lagrange polynomial defined as follows:.

11 11 Piecewise Linear Polynomial To overcome the problems with Lagrange polynomial Divide given points into overlap sequences of 4 points construct 3 rd degree polynomial that passes through these points, p 0, p 1, p 2, p 3 then p 3, p 4, p 5, p 6 etc. Then glue the curves so that they appear sufficiently smooth at joint points. Questions: 1.Why 3 rd Degree curves used? 2.How to measure smoothness at joint point?

12 12 A curve is approximated by a piecewise polynomial curve. Cubic polynomials are most often used because: (1) Lower-degree polynomials offer too little flexibility in controlling the shape of the curve. (2) Higher-degree polynomials can introduce unwanted wiggles and also require more computation. (3) No lower-degree representation allows a curve segment to be defined by two given endpoints with given derivative at each endpoints. (4) No lower-degree curves are nonplanar in 3D. Why Cubic Curves?

13 13 If the directions (but not necessarily the magnitudes) of the two segments’ tangent vectors are equal at a join point. G 1 Geometric Continuity If the direction and magnitude of Q n ( t ) through the n th derivative are equal at the join point. C n Parametric Continuity Measure of Smoothness If two curve segments join together. G 0 Geometric Continuity  C 0 Parametric Continuity C0C0 If the directions and magnitudes of the two segments’ tangent vectors are equal at a join point. C 1 Parametric Continuity C1C1 If the direction and magnitude of Q 2 ( t ) (curvature or acceleration ) are equal at the join point. C 2 Parametric Continuity C2C2

14 14 Measure of Smoothness S Joint Point C0C0 C1C1 C2C2 Q1Q1 Q2Q2 Q3Q3 TV 3 =2*TV 1 TV 2 =TV 1 Q 1 & Q 2 are C 1 and G 1 continuousQ 1 & Q 2 are C 1 and G 1 continuous Q 1 & Q 3 are G 1 continuous only as Tangent vectors have different magnitude.Q 1 & Q 3 are G 1 continuous only as Tangent vectors have different magnitude. Observe the effect of increasing in magnitude of TVObserve the effect of increasing in magnitude of TV P0P0 By increasing parametric continuity we can increase smoothness of the curve.By increasing parametric continuity we can increase smoothness of the curve.

15 15 Desirable Properties of a Curve Simple control lines need only two points curves will need more (but not significantly more) Intuitive control Physically meaningful quantities like position, tangent, curvature etc. Global Vs. Local Control Portion of curve effected by a control point. General Parameterization Handle multi-valued x-y mapping

16 16 Desirable Properties of a Curve cont’d Interpolation Vs Approximation Axis Independent Equation might change but the shape remain same under a coordinate transform (translation, rotation, scaling) of a curve = (translation, rotation, scaling) of its control points. Degree of Smoothness. May need more or less May need varying degrees of smoothness in a single curve.

17 17 Given n + 1 points P 0 ( x 0, y 0 ), P 1 ( x 1, y 1 ), …, P n ( x n, y n ) If we require the curve to pass through all the points. Interpolation we wish to find a curve that, in some sense, fits the shape outlined by these points. If we require only that the curve be near these points. Approximation Based on requirements we are faced with two problems: Interpolation Vs. Approximation

18 18 Parametric Representation of Lines Interpolation of two points In Parametric form: P1P1 P2P2 Parameter T Co-eff C Basis Matrix M Geometry G Blending Function B

19 19  CTtQ    ddd ccc bbb aaa ttttQ zyx zyx zyx zyx T                C 1 23 Parametric Cubic Curves

20 20 Parametric Cubic Curves Now co-efficient matrix C can be expressed as a multiple of basis(weight) matrix M and geometry matrix G.   GMTCTtztytxtQ   vector geometry ixbasis matr G G G G mmmm mmmm mmmm mmmm ttttQ                          4 3 2 1 44434241 34333231 24232221 14131211 23 1)( Each element of geometry vector G has 3 component for x, y and z. Components of G can be expressed as G x, G y and G z.

21 21   x x x x x g g g g mmmm mmmm mmmm mmmm tttGMTtx 4 3 2 1 44434241 34333231 24232221 14131211 23 1)(     x functionblendinga x x x gmtmmtmt gm mtmt gm mtmt gm mtmttx 4443424 2 14 3 3433323 2 13 3 2423222 2 12 3 1413121 2 11 3                              Parametric Cubic Curves Multiplying out only the x-component we get The curve is a weighted sum of the elements of geometry matrix The weights are each cubic polynomials of t called blending function

22 22 Derivative of Q(t) Derivative of Q(t) is the parametric tangent vector of the curve.

23 23 A curve segment Q ( t ) is defined by constraints on: Each cubic polynomial of Q ( t ) has 4 coefficients, (1) endpoints (2) tangent vectors and (3) continuity between segments so 4 constraints will be needed, allowing us to formulate 4 equations in the 4 unknowns, then solving for the unknowns. Curve Design : Determining C

24 24 A cubic Hermite curve segment interpolating the endpoints P 1 and P 4 is determined by constraints on the endpoints P 1 and P 4 and tangent vectors at the endpoints R 1 and R 4 P1P1P1P1 P4P4P4P4 R1R1R1R1 R4R4R4R4 Hermit Curves

25 25 The Hermite Geometry Vector: The constraints on x (0) and x (1): Hermit Curves

26 26 Hence the tangent-vector constraints: The 4 constraints can be written as: Hermit Curves

27 27 Hermit Curves

28 28 1 1 t f(t)f(t)f(t)f(t) P1P1P1P1 P4P4P4P4 R1R1R1R1 R4R4R4R4 The Hermite Blending Functions Hermit Curves

29 29 Indirectly specifies the endpoint tangent vectors by specifying two intermediate points that are not on the curve. P1P1P1P1 P4P4P4P4 P2P2P2P2 P3P3P3P3 Bézier Curves

30 30 The Bézier Geometry Vector: Bézier Curves

31 31 The 4 polynomials in B B = T. M B are called the Bernstein polynomials. Bézier Curves

32 32 The Bernstein Polynomials 1 1 t f(t)f(t)f(t)f(t) Bézier Curves A Bézier curve is bounded by the convex hull of its control points.

33 33 What's a Spline? Smooth curve defined by some control points Moving the control points changes the curve

34 34Splines

35 35 Other Curves Natural Cubic Spline C 0, C 1 and C 2 continuous cubic polynomial Smoother than previous curves which don’t have C 2 continuity. Interpolates all of the control points B-Splines C 0, C 1 and C 2 continuous cubic polynomial Don’t interpolate the control points Varieties: Uniform Vs Nonuniform Rational Vs Non-rational Catmull-Rom splines And many more….

36 36 Q(0) Q(1) Catmull-Rom Splines Interpolation splines i.e. Passes through all control points. Tangent at any control point is parallel to the line joining the control points adjacent to that point.

37 37 Curve Rendering Brute-Force method Forward differencing Recursive sub-division Brute-Force method t = 0; for (i=0; i <= 100; i++) { x(t) = a x t 3 + b x t 2 + c x t+ d x y(t) = a y t 3 + b y t 2 + c y t+ d y x(t) = a z t 3 + b z t 2 + c z t+ d z Plot3d( x(t), y(t), z(t) ); t += 0.01; }

38 38 Curve Rendering Forward differencing method

39 39 Curve Rendering Forward differencing method  = 1 / n; f =d;  f = a  3 + b  3 + c  ;  f 2 = 6a  3 + 2b  2 ;  f 3 = 6a  3 ; Plot(f.x, f.y, f.z ); for (i=0; i <= n; i++) { f +=  f ;  f +=  f 2 ;  f 2 +=  f 3 ; Plot(f.x, f.y, f.z ); }

40 40 Curve Rendering Recursive sub-division Void DrawCurveRecSub(curve,  ) { if (Straight(curve,  ) DrawLine(curve); else { SubdivideCurve(curve, leftCurve, rightCurve); DrawCurveRecSub(leftCurve,  ); DrawCurveRecSub(RightCurve,  ); } P1P1 P4P4 P2P2 P3P3 d2d2 d3d3 Straight if d 2 <  and d 3 < 

41 41 Sub-Division of Bézier Curves

42 Curved Surfaces

43 43 Planer Surfaces Using bi-linear interpolation

44 44 Parametric Bicubic Surfaces

45 45 Parametric Bicubic Surfaces Generalization of parametric cubic curves The elements of geometry matrix are curves themselves instead of constants.

46 46 Parametric Bicubic Surfaces

47 47 Parametric Bicubic Surfaces

48 48 Hermite Surfaces Harmite Surfaces are completely defined by a 4X4 geometry Matrix G H The surface is a stacking of (s) Curves Each (s) curve is a Harmite Curve With end points and end tangents as function of (t)

49 49 Hermite Surface

50 50 Hermite Surface P(0,0) P(0,1) P(1,1) P(1,0) t s

51 51 Connecting Hermite Patches To join two patches in s direction: Patch 1 Patch 2 t = 1 t = 0 s = 1 s = 0 s = 1 t = 1 t = 0 t s For C 1 continuity k = 1

52 52 Bézier Surface Bézier geometry matrix G consists of 16 control points. Bézier bicubic formulation can be derived in exactly the same way as the Hermite cubic: P 41 P 42 P 43 P 44 P 34 P 24 P 14 P 13 P 12 P 11 P 21 P 31 P 32 P 33 P 22 P 23


Download ppt "1. 2 The use of curved surfaces allows for a higher level of modeling, especially for the construction of highly realistic models. There are several approaches."

Similar presentations


Ads by Google