0

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!

user399955
  • 98
  • 1
  • 1
  • 9

2 Answers2

0

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

leoger
  • 1,074
  • 10
  • 16
  • 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... – user399955 Jul 23 '10 at 07:09
0

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:

How to find control points for a BezierSegment given Start, End, and 2 Intersection Pts in C# - AKA Cubic Bezier 4-point Interpolation

Community
  • 1
  • 1