Paton J. Lewis: Graphics Projects

Least-Squares Spline Manipulation

The above image shows a snapshot of an application that draws a b-spline with four or more control points, and allows the user to not only manipulate the shape of the spline by moving the control points, but also by directly manipulating the spline. The image above shows a spline (drawn in black) with seven control points (drawn in blue). The red tangent line is the current selection point (the mouse cursor was not captured by the image grabber). The application uses a least-squares linear solver to determine how to move the control points minimally so that the center of the red tangent line remains under the mouse cursor. This allows the user to manipulate the shape of the spline directly, instead of indirectly with the control points. In addition, the tangent can be rotated around the selection point in order to change the angle of the curve at that point.


Copyright © 1998-2010 Paton J. Lewis. All rights reserved.