21
Limitations of Polygonal Meshes • Planar facets • Fixed resolution • Deformation is difficult 

126741477 Curves and Surfaces

Embed Size (px)

DESCRIPTION

foley

Citation preview

  • Limitations of Polygonal Meshes

    Planar facets

    Fixed resolution

    Deformation is difficult

  • Representing Polygon Meshes

    1). The explicit way: just list 3D vertices of each polygon in a certain

    order. The problems are, firstly it represents same vertex many

    times and secondly, no explicit representation of shared edges

    and vertices

    2). Pointer to a vertex list: store all vertices once into a numbered

    list, and represent each polygon by its vertices. It saves space

    (vertex only listed once) but still has no explicit representation of

    shared edges and vertices

    3). Explicit edges: list all edges that belong to a polygon, and for

    each edge list the vertices that define it along with the polygons

    of which it is a member.

    )),,(),...,,,(),,,(( 222111 nnn zyxzyxzyxP

    )5,4,3,1(P

    ),,( 121 PVVE

  • Types of Curves

    1). Explicit:

    In the Cartesian plane, an explicit equation of a planar curve is

    given by y = f(x). The difficulties with this approach are that

    (1) it is impossible to get multiple values of y for a single x, so

    curves such as circles and ellipses must be represented by

    multiple curve segments; and (2) describing curves with vertical

    tangents is difficult and numerically unstable.

    2). Implicit:

    f(x, y) = 0 Ax+By+C =0

    This method has difficulties on determining tangent continuity of

    two given curves which is crucial in many applications.

    (Circle can be defined as: x2+y2=1, but what about a half circle?)

  • Types of Curves

    3). Parametric Curves:

    The cubic polynomials that defines a curve segment Q(t)= [x(t)

    y(t)]T are of the form

    Written in matrix form, it becomes

    Q(t)= [x(t) y(t)] = T C

    where

    yyyy

    xxxx

    dtctbtaty

    dtctbtatx

    23

    23

    )(

    )(

    x

    y

    y

    y

    y

    x

    x

    x

    d

    c

    b

    a

    d

    c

    b

    a

    C 123 tttT

  • Continuity

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

    Applying the definition to the curves equation, we have

    Often we will want to represent a curve as a series of curves pieced

    together. But if we will want these curves to fit together reasonably ...

    continuity!

    yyyxxx ctbtactbta

    CttCTdt

    d

    dt

    dy

    dt

    dxtQtQ

    dt

    d

    2323

    ]0123[

    )(')(

    22

    2

  • Continuity

    Two curve segments

    join together: G0

    geometric continuity.

    The directions of the tangent

    vectors (not necessarily the

    magnitudes) are equal: G1

    geometric continuity.

    Both the directions and

    magnitudes are equal: C1

    parametric continuity.

    Second-order parametric

    continuity: C2 parametric

    continuity.

    Note: For two curves to join smoothly, we require only that their tangent-vector

    directions match; we do not require that their magnitudes match.

  • Specifying Curves

    Interpolating spline

    curve passes through the knots

    knots

    control points that lie on the

    curve

    Control points

    a set of points that influence

    the curve's shape

    Approximating spline

    control points merely influence

    shape (Hermite Curves, B-spline)

  • Specifying curves

    Control Points: A set of points that influence

    the curves shape.

    Knots: Control points that lie on the

    curve.

    Interpolating spline: Curve passes through the

    control points.

    Approximating spline: Control points merely influence

    shape.

  • Hermite Spline

    A spline is a parametric curve defined by control points

    The term spline dates from engineering drawing, where a spline was a piece of flexible wood used to draw smooth curves

    The control points are adjusted by the user to control the shape of the curve

    A Hermite spline is a curve for which the user provides:

    The endpoints of the curve

    The parametric derivatives of the curve at the endpoints (tangents with length)

    The parametric derivatives are dx/dt, dy/dt, dz/dt

    That is enough to define a cubic Hermite spline, more derivatives are required for higher order curves

  • Hermite Spline (2)

    Say the user provides

    A cubic spline has degree 3, and is of the form:

    For some constants a, b, c and d derived from the control points, but how?

    We have constraints:

    The curve must pass through x0 when t=0

    The derivative must be x0 when t=0

    The curve must pass through x1 when t=1

    The derivative must be x1 when t=1

    dctbtatx 23

    1010 ,,, xxxx

  • Bzier Curves

    Hermite cubic curves are difficult to model need to specify point and gradient.

    More intuitive to only specify points.

    Pierre Bzier specified 2 endpoints and 2 additional control points to specify the gradient at the endpoints.

    Can be derived from Hermite matrix: Two end control points specify tangent

  • Bezier Curve Properties

    The first and last control points are interpolated

    The tangent to the curve at the first control point is along the line joining the first and second control points

    The tangent at the last control point is along the line joining the second last and last control points

    The curve lies entirely within the convex hull of its control points

    The Bernstein polynomials (the basis functions) sum to 1 and are everywhere positive

    They can be rendered in many ways

    E.g.: Convert to line segments with a subdivision algorithm

  • Rendering Bezier Curves (1)

    Evaluate the curve at a fixed set of parameter values and join the points with straight lines

    Advantage: Very simple

    Disadvantages:

    Expensive to evaluate the curve at many points

    No easy way of knowing how fine to sample points, and maybe sampling rate must be

    different along curve

    No easy way to adapt. In particular, it is hard to measure the deviation of a line segment from

    the exact curve

  • Convex Hull Property

    If we take all of the control points for a Bezier curve and construct a convex polygon around them, we have the

    convex hull of the curve

    An important property of Bezier curves is that every point on the curve itself will be somewhere within the convex

    hull of the control points

    p0

    p1

    p2

    p3

  • Connecting Bezier Curves

    A simple way to make larger curves is to connect up Bezier curves

    Consider two Bezier curves defined by p0p3 and v0v3 If p3=v0, then they will have C

    0 continuity

    If (p3-p2)=(v1-v0), then they will have C1 continuity

    C2 continuity is more difficult

    p0

    p0

    p1

    p2

    P3

    P3

    p2

    p1 v0

    v1

    v2

    v3

    v3

    v2

    v1

    v0

    C0 continuity C1 continuity

  • A Bzier Curve

    For example, if we are given four control points (0,0), (0.2,0.8), (0.9,

    0.1), (1,1). Then we have

    And the parametric equation will be

    At any point on this curve, the tangent vector to the curve is

    00

    4.26.0

    5.45.1

    1.31.1

    11

    1.09.0

    8.02.0

    00

    0001

    0033

    0363

    1331

    yx

    yx

    yx

    yx

    dd

    cc

    bb

    aa

    tttty

    ttttx

    4.25.41.3)(

    6.05.11.1)(

    23

    23

    00|]

    )(,

    )([|)(' tttt

    dt

    tdy

    dt

    tdxtQ

  • There are nonuniform, nonrational B-splines, which differ from the uniform, nonrational B-Splines in that the Uniform B-splines have knots at equal intervals in t. The distances in t between adjacent knots are the same, and the blending functions for each curve segment are the same.

    In nonuniform B-Splines, the parametric intervals between knots are not equal, and therefore the blending functions are no longer the same for each interval, but vary from curve segment to curve segment.

    These curves have several advantages over uniform B-splines:

    Continuity of join points can be reduced from C2 to C1 to C0 to none. If the continuity is reduced to none, then the curve interpolates a control point, but without the effect of uniform B-splines, where the curve segments on either side of the control point are straight lines.

    The starting and ending points can be interpolated exactly, without introducing straight line segments.

    It is possible to add an additional knot and control point so that the resulting curve can be easily reshaped, whereas this cannot be done with uniform B-splines.

  • A Bezier curve lies within a convex hull of the control polygon Convex Hull the minimum convex polygon enclosing a set of given points

  • Convex hull property

    The convex hull property ensures that the curve will never pass outside of the convex hull formed by the four control vertices. As such, it lends a

    measure of predictability to the curve. The Bezier basis functions satisfy

    the conditions necessary for the convex hull property, namely:

    0

  • Summary of Bezier and Hermite Curves

    offer local control

    offer C1 continuity

    interpolates (some) control points

    Splines

    splines are cubic curves which maintain C2 continuity.

    natural spline

    interpolates all of its control points.

    equivalent to a thin strip of metal forced to pass through control points

    no local control

    B-spline

    local control

    does not interpolate control points

  • NURBS: Nonuniform Rational B-splines

    One of the disadvantages of the curves discussed to date is that they cannot be used to create common conic shapes such as

    circles, ellipses, parabolas, etc. This can be done using rational

    cubic curves, however. A rational cubic curve segment in 3D can

    be constructed as follows

    x(t) = X(t)/W(t) y(t) = Y(t)/W(t) z(t) = Z(t)/W(t) where each of X(t), Y(t), Z(t), and W(t) are cubic polynomial curves. Defining curves as

    rational polynomials in this manner allows for simple exact

    represenations of conic sections such as circles, as well as curves

    which are invariant under perspective projection.