Reputation: 1970
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 :
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
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:
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
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