• Create Account

## Constant speed animation along cubic Hermite spline?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1Prune  Members

223
Like
0Likes
Like

Posted 12 November 2013 - 02:46 PM

I couldn't find clear information about arc-length parameterization of cubic Hermite splines. How would I do this? I need to be able to do position=CalcPos(t) where the distance traced out by position is proportionate to delta-t. What's the best way to do this?

"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)

### #2FLeBlanc  Members

3133
Like
1Likes
Like

Posted 12 November 2013 - 03:27 PM

One quick and hacky way to do it is to advance along the curve using very tiny increments of the curve parameter, s, accumulating distance as you go until you reach the distance you want to move. It's not as elegant as a numerical solution, but it's easy to do and should probably be fast enough for most applications.

### #3ryt  Members

294
Like
0Likes
Like

Posted 14 November 2013 - 12:41 PM

You could do what FLeBlanc suggested. Calculate position for some value t and than find the distance between current position and last position. Check to see if distance is greater or smaller than the distance you wanted to pass. If it is then move along that distance by the amount you want.

1880
Like
0Likes
Like

Posted 15 November 2013 - 08:47 AM

Yeah, as far as I know, there's not a simple arc-length formula you can plug a parameter into. You'd have to do some numerical integration at some point. I guess FLeBlanc's method is a type of numerical integration as well, but it's way more suited to a gaming application.

### #5Prune  Members

223
Like
0Likes
Like

Posted 25 November 2013 - 11:59 AM

Thanks. Looks like I might stick to the 1D case with a spline per degree of freedom that animation tools can export, where arc length isn't an issue.

"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.