###

» Sat Aug 08, 2009 7:16 pm

i can say that certainly my way of doing it would be alot less of a draw for something with 20 points than you're method, and controlling higher order bezier curves gets counter intuitive. theres no plain and simple way to make large amounts of point into a smooth curved line.

using my method the transition between them would be perfect, as long as youre drawing events did 0.0-1.0 for the t value of the beziers, and the points were all on integer positions (round(x),round(y)).

when drawing a bezier as a full line (im assuming youre not simply wanting to get a points position based on an expression, but rather drawing a line like in my picture), u need to use loops, and for it to be smooth u need to use a large amount of loops. for a 20 point spline, made of cubics, running a loop 100 times to draw each of the 5 cubic beziers which make up the 20 point spline, youd need to run a cubic expression a total of 500 times, (1000 if you count that youre doing it for x and y, and 2000 if you count that youre doing it for x and y, and drawing a line from the point drawn before to the current one). if you were using a single bezier of 20 points, youd need to run an expression that would probably be too long to even list in the length of this entire thread, 2000 times.

it takes alot of power to do this stuff. e.g. truetype font was chosen over type 1 simply because it used quarp to define curves instead of cubic.

i understand you feel adding lerp^n would be a good idea, but when you actually look at different order beziers in plain algebra instead of 5 letter things you can easily write, you realize how much more expensive and complicated they get from one iteration to the next.

lerp is simply " a+(b-a)*t "

qarp is " ((a+(b-a)*t)+((b+(c-b)*t)-(a+(b-a)*t))*t) "

cubic is " ((a+(b-a)*t)+((b+(c-b)*t)-(a+(b-a)*t))*t)+(((b+(c-b)*t)+((c+(d-c)*t)-(b+(c-b)*t))*t)-((a+(b-a)*t)+((b+(c-b)*t)-(a+(b-a)*t))*t))*t "

and so forth.

a generalization is every bezier is made up of the bezier type before it for each of the *n* points as the 3 values inside of a lerp.

qarp is really just lerp(smaller)+(lerp(bigger)-lerp(smaller))*t

cubic is really just qarp(smaller)+(qarp(bigger)-qarp(smaller))*t

they grow fractally is the best way i find to describe it larger parts made of smaller parts repeating until made up to their simplest form.

for a n point curve things would get really, really long. qarp, a 4 point curve is all ready pretty big, 5 would be 3 times as big, 6, 9 times and so forth for 3^n or wtv.