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):
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) )
p(u) = C*b(0,u) + C*b(1,u) + Cb(2,u) + Cb(3,u);
or even more plugging:
p(u) = Cu^3 + C3u^2(1-u) + C3u(1-u)^2 + C(1 - u)^3
and there are a hundred different ways of expressing it, optimizing the math, etc.
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).]