19curve0

Upload: kannanviknesh

Post on 04-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 19curve0

    1/14

    Curved Surfaces

    Sweep Representations

    Constructive Geometry

    Bezier Curves

  • 8/13/2019 19curve0

    2/14

    Sweep representations

    Sweep representations are used to construct 3D objects that have some kind

    of symmetry.

    For example, a prism can be generated using a translational sweep

    Rotational sweeps can be used to create curved surfaces like an ellipsoid or

    a torus

    In both cases, you start with a cross-section and generate more vertices by

    applying the appropriate transformation.

    More complex objects can be formed by using more complex transformations.

    Also, you can define a path for a sweep that allows you to create more inter-

    esting shapes.

  • 8/13/2019 19curve0

    3/14

    Translational Sweep

  • 8/13/2019 19curve0

    4/14

    Rotational Sweep

  • 8/13/2019 19curve0

    5/14

    Constructive Solid Geometry

    Another approach to object modeling consists of using set operations to com-

    bine two objects.

    Union

    Intersection

    Difference

    Generally start with a set of primitives that serve as building blocks.

    Ray casting is a method used for determining boundaries of the resulting

    object if you start with a boundary representation.

    Octree representations are designed to make this process easier.

  • 8/13/2019 19curve0

    6/14

    Constructive Geometry Example

    Figure b is the intersection of the original solids

    Figure c is the difference between the two original solids

  • 8/13/2019 19curve0

    7/14

    Ray Casting

    Operation Surface Limits

    Union A, D

    Intersection C, B

    Difference (obj2 obj1) B, D

  • 8/13/2019 19curve0

    8/14

    Quadtree and Octree Representations

    The basic idea is to divide space up into homogeneous regions.

    Use a tree structure with large regions near the root

    If a region is uniform, store its properties

    If a region is non-uniform, subdivide it and repeat the process

  • 8/13/2019 19curve0

    9/14

    Curves

    Curves are used in graphics for a number of purposes

    to represent surfaces (usually tessellated)

    to represent paths for motion

    Splines approximate curves with a series of polynomial segments

    There are a number of common approaches

    Bezier curves

    Cubic splines

    B-Splines

    Rational splines

  • 8/13/2019 19curve0

    10/14

  • 8/13/2019 19curve0

    11/14

    Geometric Algorithm for Bezier curves

    P0

    A B

    C

    B1C1A1

    P3

    P2P1

    Start with endpoints and two control points

    find midpoints of lines joining these points

    find midpoint of lines joining points generated in 2

    find midpoint of line joining points generated in 3

    Recursively apply algorithm to two new sets of points until segments are short

    enough to make a smooth curve

  • 8/13/2019 19curve0

    12/14

    Parametric Curves

    A curve can be represented as a set of functions that represent x and y values

    as a function of some parameter, t the parametric representation of a circle is

    x(t) = r cos t

    y(t) = r sin t

    each value of t generates one point on the curve

  • 8/13/2019 19curve0

    13/14

    Parametric representation of Bezier curves

    For a third-order Bezier curve, we can represent the curve as

    B(t) =

    x

    y

    = (1 t)3P0+t(1 t)2P0+t2(1 t)P2+t3P3

    B(t) = P0 and B(t) = P3 so we have a cubic curve which goes through

    P0 and P3. The vectors P0P1 and P2P3 are tangent to the curve at the

    endpoints.

    P0

    A B

    C

    B1C1A1

    P3

    P2P1

    This property of the tangents guarantees that the recursively generated curve

    is smooth

  • 8/13/2019 19curve0

    14/14

    Curved Surfaces

    The same algorithms can be used for curves in three dimensions just add

    z-coordinates to the equations