# Movement at constant speed on a curve

This topic is 4865 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

In my side-scrolling game, terrain is modeled by a set of 3rd degree polynomials f(x)=ax^3+bx^2+cx+d on [0,128] which each define the height of the land on an area of that size. To model a particle moving along the ground at a constant rate, I tried to parameterize the curve with respect to arc length, but I can't quite get it working. Here's what I did: -Rewrite the curve as r(t)=<t,f(t)> -Take |r'(t)|=Sqrt(9a^2t^4+12abt^3+(6ac+4b^2)x^2+4bcx+c^2+1) -Use s(t)=t/|r'(t)| as a parameter If I understand correctly, the point given by r(s(t)) is at arc length t on the curve. However, I must be doing something wrong, because my particle moves at variable speed even as I increase t at a constant rate, even skipping around sometimes. Where's my mistake?

##### Share on other sites
I'll just point you to a doc by Dave Eberly:

Moving at Constant Speed

##### Share on other sites
Works beautifully, thanks much. I'd never heard of Newton's method before, that's really clever. The directory it's in looks great, too, I wish I'd known about this a while ago.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5
JoeJ
18

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632998
• Total Posts
3009805
• ### Who's Online (See full list)

There are no registered users currently online

×