Вы находитесь на странице: 1из 21

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.


)) , , ( ),..., , , ( ), , , ((
2 2 2 1 1 1 n n n
z y x z y x z y x P =
) 5 , 4 , 3 , 1 ( = P
) , , (
1 2 1
P V V E =
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: x
2
+y
2
=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


y y y y
x x x x
d t c t b t a t y
d t c t b t a t x
+ + + =
+ + + =
2 3
2 3
) (
) (
(
(
(
(
(

=
x
y
y
y
y
x
x
x
d
c
b
a
d
c
b
a
C
| | 1
2 3
t t t T =
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!

| |
y y y x x x
c t b t a c t b t a
C t t C T
dt
d
dt
dy
dt
dx
t Q t Q
dt
d
+ + + + =
= =
(

= =
2 3 2 3
] 0 1 2 3 [
) ( ' ) (
2 2
2
Continuity
Two curve segments
join together: G
0

geometric continuity.

The directions of the tangent
vectors (not necessarily the
magnitudes) are equal: G
1

geometric continuity.

Both the directions and
magnitudes are equal: C
1

parametric continuity.

Second-order parametric
continuity: C
2
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 x
0
when t=0
The derivative must be x
0
when t=0
The curve must pass through x
1
when t=1
The derivative must be x
1
when t=1
d ct bt at x + + + =
2 3
1 0 1 0
, , , x x x x ' '
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
p
0
p
1
p
2
p
3
Connecting Bezier Curves
A simple way to make larger curves is to connect up Bezier curves
Consider two Bezier curves defined by p
0
p
3
and v
0
v
3
If p
3
=v
0
, then they will have C
0
continuity
If (p
3
-p
2
)=(v
1
-v
0
), then they will have C
1
continuity
C
2
continuity is more difficult
p
0
p
0
p
1
p
2
P
3
P
3
p
2
p
1
v
0
v
1
v
2
v
3
v
3
v
2
v
1
v
0
C
0
continuity

C
1
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


(
(
(
(

=
(
(
(
(

(
(
(
(



=
(
(
(
(
(

0 0
4 . 2 6 . 0
5 . 4 5 . 1
1 . 3 1 . 1
1 1
1 . 0 9 . 0
8 . 0 2 . 0
0 0
0 0 0 1
0 0 3 3
0 3 6 3
1 3 3 1
y x
y x
y x
y x
d d
c c
b b
a a
t t t t y
t t t t x
4 . 2 5 . 4 1 . 3 ) (
6 . 0 5 . 1 1 . 1 ) (
2 3
2 3
+ + =
+ + =
0 0
| ]
) (
,
) (
[ | ) ( '
t t t t
dt
t dy
dt
t dx
t Q
= =
=
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 <= f
i
(t) <= 1 for t in [0,1].
f
1
(t) + ... + f
n
(t) = 1


Convex hull property holds for bezier curves and b-splines.

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.

Вам также может понравиться