yohan zhou
yohan zhou

Reputation: 1970

Cubic Bezier from sample points

The sample points is taken from a flying machine in a fix sample rate (e,g 1s=25 frame), it contains the x,y,z position.

The requirement is to import the point lists and edit the curve, then export it to a new point lists. I want to use the Cubic Bezier curve to display the points, the problem is :

  1. The flying path is arbitrary, can it always be drawn in Bezier curve?
  2. How to confirm the vertex and control points?

The reason of vertex and control point is for editing, i want to drag the control point to modify the curve.

Am new for this field, any suggestion or sample code is appreciated. :)

Upvotes: 3

Views: 2319

Answers (1)

divanov
divanov

Reputation: 6339

Cubic Bezier spline won't fit to an arbitrary digitized curve. If Cubic Bezier spline approximate your curve with unacceptable square error, there are two options:

  1. Split original curve into segments (for example, where curve bends) and then fit segments with Cubic Bezier splines. There is a description of an algorithm for automatically fitting digitized curves

  2. Use higher order Bezier splines than cubic, which can fit any continuous smooth curve. This will result in iterative process to find Bezier spline of minimum order fitting the curve with an acceptable error.

Upvotes: 2

Related Questions