in Carlos Icaza, Graphics

Moving an Object Seamlessly Along a Path. Introduction.

In the field of splines there are two common approaches to finding points along a given curve. One is that of the curve’s original t parameter, the other one is done by computing the arc-length of the curve. The second approach is commonly known as arc-length parameterization. There are also two approaches on solving the continuity of curve segments and segment re-parameterization. One is to keep the degree of the curve unchanged and the other one is to raise the degree of the curve altogether.

Typically, one of the easiest ways to move an object along a curve segment involves traversing the object along the curve’s t parameter between [0,1]. For each value of t, get the corresponding x and y coordinate of the curve, and move the object from its previous x,y to the new x,y coordinate value. Depending on how exact you want the curve, the animation will look smooth or jaggy. Due to the nature of parameterization, x and y coordinates are not evenly spaced, and depending on the curve curvature, an object will move at different speeds at different locations on the curve segment. The difficulty lies in specifying the object’s speed if using t values due to the fact that x and y coordinates are not representative of a curve’s length, and a curve’s length and its relationship to the value of t is non-linear.

Thus, we are introduced to arc-length parameterization. In order to compute evenly spaced coordinates along a curve we want to evaluate the point based on their arc-length rather than using the coordinates of the curve’s parametric t value.

I will follow up with sample code to retrieve s values for the arc-length of a curve and then move the object seamlessly along the s coordinates.

In the meantime, here are some references for you to enjoy on the subject matter..

DeRose, T.D., Goldman, R.N., Hagan, H. and Mann, S. “Functional Composition Algorithms Via Blossoming”, “ACM Transactions on Graphics 1993 12(2) pp 113-135.

Peterson J.W. “Arc-Length Parameterization of Spline Curves”, http://www.saccade.com/writing/graphics/RE-PARAM.PDF

Bartels, R.H., Beatty, J.C., and Barsky, B.A., An Introduction to Splines for use in Computer Graphics and Geometric Modelling, Morgan Kaufmann (Los Altos), 1987.

Farin, G., Curves and Surfaces for Computer Aided Geometric Design,, (5th Ed.) Academic Press (San Diego)

Jens Gravesen. “The Length of Be ́zier Curves”. Graphics Gems V, pp. 199–205. Academic Press, Boston, 1995.

Brian Guenter and Richard Parent. “Computing the Arc Length of Parametric Curves”. IEEE Computer Graphics and Applications, Vol. 10, No. 3, pp. 72–78, May 1990.

Walter, M. and Fournier, A. “Approximate Arc Lengh Parameterization”, SIBGRAPI (1996) 143–150

Write a Comment

Comment