Determine arc-length of a Catmull-Rom spline

Posted by Wouter on Game Development See other posts from Game Development or by Wouter
Published on 2011-07-18T13:37:02Z Indexed on 2012/04/09 23:49 UTC
Read the original article Hit count: 748

Filed under:
|
|
|
|

I have a path that is defined by a concatenation of Catmull-Rom splines. I use the static method Vector2.CatmullRom in XNA that allows for interpolation between points with a value going from 0 to 1.

Not every spline in this path has the same length. This causes speed differences if I let the weight go at a constant speed for every spline while proceeding along the path. I can remedy this by letting the speed of the weight be dependent on the length of the spline. How can I determine the length of such a spline? Should I just approximate by cutting the spline into 10 straight lines and sum their lengths?

I'm using this for dynamic texture mapping on a generated mesh defined by splines.

© Game Development or respective owner

Related posts about XNA

Related posts about math