Graphics Reference
In-Depth Information
3.5
3
2.5
2
1.5
1
0.5
0
0
0.2
0.4
0.6
t
0.8
1
1.2
Fig. 9.7. Linear interpolation using a quadratic Bernstein interpolant.
9.3.2 Quadratic Bezier Curves
Quadratic Bezier curves are formed by using Bernstein polynomials to in-
terpolate between the x -, y -and z -coordinates associated with the start- and
end-points forming the curve. For example, we can draw a 2D quadratic Bezier
curve between (1, 1) and (4, 3) using the following equations:
t )+4 t 2
y =1(1 − t ) 2 + y c 2 t (1 − t )+3 t 2
t ) 2 + x c 2 t (1
x =1(1
(9.11)
But what should be the values of ( x c ,y c )? Well, this is entirely up to us.
The position of this control vertex determines how the curve moves between
(1, 1) and (4, 3). A Bezier curve possesses interpolating and approximating
qualities: the interpolating feature ensures that the curve passes through the
end-points, while the approximating feature shows how the curve passes close
to the control point. To illustrate this, if we make x c =3and y c =4we
obtain the curve shown in Figure 9.8, which shows how the curve intersects
the end-points, but misses the control point. It also highlights two important
features of Bezier curves: the convex hull property, and the end slopes of the
curve.
The convex hull property implies that the curve is always contained within
the polygon connecting the end and control points. In this case the curve is
inside the triangle formed by the vertices (1, 1), (3, 4) and (4, 3). The slope of
the curve at (1, 1) is equal to the slope of the line connecting the start point
to the control point (3, 4), and the slope of the curve at (4, 3) is equal to the
slope of the line connecting the control point (3, 4) to the end-point (4, 3).
Naturally, these two qualities of Bezier curves can be proved mathematically.
Before moving on, there are two further points to note:
No restrictions are placed on the position of ( x c ,y c ) - it can be anywhere.
Simply including z -coordinates for the start, end and control vertices cre-
ates 3D curves.
Search WWH ::




Custom Search