# [help] Moving along bezier curve based paths at consistent intervals

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

## Recommended Posts

I have a 3D path made out of bezier curves.
Naturally moving along the curve is in percentage increments. (0 none, 0.5 half way, 1 full length)
what is the simplest way to get an increment that would keep a consistent absolute speed going through 1 curve into another.
E.G. moving 5 units at a time, as opposed to 5% at a time which would vary with curve size.

Any and all help appreciated,
Bombshell

##### Share on other sites
As you mentioned, computing distance through the curve will always be relative to the knot points. The formula for finding that spline point is simple, just a single matrix multiply. That's why games use splines so often.

But computing the linear distance traveled requires solving an elliptic integral, which is a lot more processing. If you really need to compute accurately you will need good calculus engine; you generally cannot convert an elliptic integral to simple functions, nor can you generalize to an iterative solution.

For an game-useful iterative solution just continue to solve by percentage increments across the spline and have your object move toward that point at a constant velocity. When it would reach or cross that point move to the next increment along the spline. If your increment is small enough the curve will appear smooth, and if it is too small you can simply advance the point multiple times. If your spline contains something like a tight loop, your object will need to respond appropriately, probably by simply passing over the loop.

That way you can move at whatever linear speed you want while still iterating across the curve in percentage increments.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
12
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013738
×