views:

38

answers:

3

Hi, i want to generate a bezier curve pass through several points i input by mouse.These points are more than four,can anyone help me and give me some suggestions about how to implent it? More thanks. Good luck!

A: 

what'more i also want to break one curve into two,how to make it?Thanks.

A: 

Just write the math into a program. There's nothing we can explain without doing your homework for you.

You can start doing some honest work here: Wikipedia: Bezier Curve

leo grrr
Thank you very much,i have known how to draw a bezier curve by giving several points to control it,but i do not know how to make a bezier curve go through these given points i input,what' more this is not my homework...
A: 

You have to solve the distance between points along the curve first to get your u & v.

Generally, the shortest arc lengths between points approx. the best curve.

p0 and p3 are the endpoints; f and g are two points along the curve.

d1 is distance between p0 and f; d2 between f and g; d3 between g and p3.

Solving for control points, p1 and p2:

Let u=d1/(d1+d2+d3); v=(d1+d2)/(d1+d2+d3)

This is where I link you to:

http://stackoverflow.com/questions/2315432

Zanderbander