1calc_spline(3)                  Allegro manual                  calc_spline(3)
2
3
4

NAME

6       calc_spline  -  Calculates  a  series  of values along a Bezier spline.
7       Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void calc_spline(const int points[8], int npts, int *x, int *y);
14

DESCRIPTION

16       Calculates a series of npts values along a Bezier spline, storing  them
17       in the output x and y arrays. The Bezier curve is specified by the four
18       x/y control points in the points array: points[0] and points[1] contain
19       the coordinates of the first control point, points[2] and points[3] are
20       the second point, etc. Control points 0 and  3  are  the  ends  of  the
21       spline,  and  points  1 and 2 are guides. The curve probably won't pass
22       through points 1 and 2, but they affect the shape of the curve  between
23       points  0 and 3 (the lines p0-p1 and p2-p3 are tangents to the spline).
24       The easiest way to think of it is that the curve starts at p0,  heading
25       in  the direction of p1, but curves round so that it arrives at p3 from
26       the direction of p2.  In addition to their role as graphics primitives,
27       spline  curves  can  be  useful  for constructing smooth paths around a
28       series of control points, as in exspline.c.
29
30

SEE ALSO

32       spline(3), exspline(3)
33
34
35
36Allegro                          version 4.4.3                  calc_spline(3)
Impressum