7 a Curves and Surfaces

download 7 a Curves and Surfaces

of 19

Transcript of 7 a Curves and Surfaces

  • 8/2/2019 7 a Curves and Surfaces

    1/19

  • 8/2/2019 7 a Curves and Surfaces

    2/19

    Agenda

    Parametric curves in space

    Parametric surfaces in space

  • 8/2/2019 7 a Curves and Surfaces

    3/19

    Parametric Curves

    The idea is to be able to define complexcurves (or surfaces in 3D) by controlling a

    set of points. This can be used for:

    Designing objects

    Designing trajectories of objects or cameras inanimations

    Design surfaces

  • 8/2/2019 7 a Curves and Surfaces

    4/19

    Parametric Curves

    See examples in Paint:

    You define a starting and ending point.

    Then you define two additional controlpoints The curve passes through the first and lastcontrol points

    The curve gets close to the intermediatecontrol points

  • 8/2/2019 7 a Curves and Surfaces

    5/19

    Bzier Curves

    Invented by French engineer Pierre Bzier

    Are simple to implement

    Have several features that are useful indesigning objects

  • 8/2/2019 7 a Curves and Surfaces

    6/19

    Bzier Curves

    Desirable features Order-0 continuity: curve n+1 starts where

    curve n ends. Order-1 continuity: the derivative of curve n+1where it starts is the same as the derivative ofcurve n where it ends.

    The curve is confined within the convex-hull formed by the control points

  • 8/2/2019 7 a Curves and Surfaces

    7/19

    Bzier Curves

    Some examples:

  • 8/2/2019 7 a Curves and Surfaces

    8/19

    Bzier Curves

    How to create a closed curve:

  • 8/2/2019 7 a Curves and Surfaces

    9/19

    Bzier Curves

    How to make the curve pass closer to apoint:

  • 8/2/2019 7 a Curves and Surfaces

    10/19

    Bzier Curves the Math

    For n+1 controlpoints:

    BEZ, the blendingfunctions, are theBernsteinpolynomials:

    C(n,k) are thebinomialcoefficients:

    n

    k

    nkk uuBEZu0

    ,10),()( pP

    1

    , )1(),()(

    kk

    nk uuknCuBEZ

    )!(!

    !),(

    knk

    nknC

  • 8/2/2019 7 a Curves and Surfaces

    11/19

    Bzier Curves the Math

    The vectorialequationrepresents three

    parametricequations:

    n

    k

    nkk uBEZxux0

    , )()(

    n

    k

    nkk uBEZyuy0

    , )()(

    n

    k

    nkk uBEZzuz0

    ,)()(

  • 8/2/2019 7 a Curves and Surfaces

    12/19

    Bzier Curves the Math

    For instance, for n = 3

    3

    3,0 )1()( uuBEZ 2

    3,1 )1(3)( uuuBEZ

    )1(3)(2

    3,2 uuuBEZ

    3

    3,3 )( uuBEZ

  • 8/2/2019 7 a Curves and Surfaces

    13/19

    Bzier Curves the Math

    Blending functions

    from: www.cs.virginia.edu/~gfx/Courses/2001/Intro.fall.01/Lectures/lecture21.ppt

  • 8/2/2019 7 a Curves and Surfaces

    14/19

    Bzier Curves

    Zero and one continuity The curve connects the first and last control

    points:

    Values for the parametric first derivatives of aBzier curve can be calculated as:

    np

    p

    )1(

    )0( 0

    P

    P

    nn nn

    nn

    ppP

    ppP

    1

    10

    )1('

    )0('

  • 8/2/2019 7 a Curves and Surfaces

    15/19

    Bzier Curves

    Therefore, it is easy to connect two curveswith 0 and 1 continuity:

  • 8/2/2019 7 a Curves and Surfaces

    16/19

    Parametric Surfaces

    Parametric Bzier surfaces:

    Note that two (u, v) parameters areneeded.

    n

    k

    nkmjkj

    m

    j

    uBEZvBEZpvuP0

    ,,,

    0

    ,

  • 8/2/2019 7 a Curves and Surfaces

    17/19

    Parametric Surfaces

    Examples:

  • 8/2/2019 7 a Curves and Surfaces

    18/19

    Parametric Surfaces

    Surfaces can also be connected with 0-and 1-continuity:

  • 8/2/2019 7 a Curves and Surfaces

    19/19

    Other types of curves (andsurfaces

    Hermite Interpolation

    Cardinal Splines

    Kochanek-Bartels Splines B-splines

    Non-uniform rational b-spline curves

    (NURBS)