Game Development Reference

In-Depth Information

Figure 14.11
3 degree Bezier curve with its four control points

On the basis of this observation, we can define rational Bezier curves:

i
=
0
B
i
,
n
(
u
)
w
i
P
i

C(
u
)

=

i
=
0
B
i
,
n
(
u
)
w
i

0

≤

u

≤

1

(14.4)

where the
P
i
(respectively the
B
i
) are the control points (respectively the Bernstein

polynomials). The
w
i
are scalars called the weights of the control points. Their role is

attracting
the curve towards or
pushing
it
back
from the control points.

Generally, using a smaller number of control points makes it difficult to easily

draw an appropriate shape. If the number of control points is increased, the degree

of polynomials increases consequently. This makes them less useful not only in digital

terms (digital instability, calculation costs), but also their interactive use (a control

point has an influence on the entire curve which restricts the possibilities of highly

localised modifications). We will thus create Bezier curves joined end to end, by adding

continuity constraints to them. For this purpose, we will use certain control points

several times.

Curve
C
(
u
) is then defined on
u

∈

≤

≤

[0, 1] and is made up of segments
C
i
(
u
), 1

i

m
.

These segments are joined at their ends
u
0

1 with a certain

level of continuity. We say that curve
C
k
is continuous at the end
ui
if
C
(
j
)

i

=

0
< u
1
< u
2
< u
3
< u
4

=

C
(
j
)

i

(
u
i
)

=

1
(
u
i
)

+

k
, where
C
(
j
)

for every 0

i
represents the
j
-th derivative of
C
i
. The following

definition is used to make the equations compatible with a computer installation:

≤

j

≤

n

C
(
u
)

=

N
i
,
p
P
i

a

≤

u

≤

b

(14.5)

i

=

0

where the
P
i
are the control points and
N
i
,
p
are the basic B-spline functions of degree

p
. Various approaches can be taken to define these basic B-spline functions.

We will only use the recurrent approach, which is well suitable for a computer

installation.

The B-spline has connecting control points between its segments which are

called nodes. A sequence of these nodes is called knot vector and is written as

U

=

(
u
0
,
...
,
u
m
).
U
is a non-decreasing sequence of real numbers. The basic B-spline

Search Nedrilad ::

Custom Search