are you trying to do, say, bezier curves? Like the ones in MS Paint?
well, if not, most documentation i’ve seen online involving bezier curves has also either hyperlinked or directly explained other types of splines.
here’s what to look for: Berstein Polynomials/functions.
it’s real easy, 11th grade algebra.
alright, here’s what i remember off the top of my head (i never really memorized it, cuz i only looked at it for a litte while, and i figured, “i have the book if i need it”
)
you take 4 points (called control points).
Points 0 and 3 are the endpoints.
Points 1 and 2 form tangent vectors w/ the endpoints, basically meaning that whereever point 1 is, the curve will initially follow a path similar to the line from point 0 to 1.
then, you get a normalizer function, u, ranging from 0…1, and plug and chug (using vector arithmitic):
given
b(i,u) = berstein function i of u
C[i] = control point i
b(0,u) = u^3
b(1,u) = 3u^2(1 - u)
b(2,u) = 3u(1 - u)^2
b(3,u) = (1 - u)^3
Point p(u) = Sum(i = 0, i < 4)( C[i]*b(i,u) )
or
p(u) = C[0]*b(0,u) + C[1]*b(1,u) + C[2]b(2,u) + C[3]b(3,u);
or even more plugging:
p(u) = C[0]u^3 + C[1]3u^2(1-u) + C[2]3u(1-u)^2 + C[3](1 - u)^3
and there are a hundred different ways of expressing it, optimizing the math, etc.
hrmm.
kinda sloppy…
could someone try and check my math?
like i said, it’s off the top of my head…
i’ll consult my book tonight, though, and have another post for you tomorrow w/ the 100% correct values. (alan watts: “3D Computer Graphics”, 2nd ed.)
hope i’m clear enough
[This message has been edited by Succinct (edited 12-05-2000).]