non language specific spline question

Miscellaneous Forums/General Discussion/non language specific spline question

Problem solved, please disregard.

Care to share problem & cure? :)

Okay,

The problem was that if you have a spline, and want to sample the data along it at regular intervals for the purposes of perhaps moving a sprite along it you need to do the following:

Make your spline's steps quite dense - so that the largest stretch between points will be smaller than the actual sampled point distance you require. This ensures you have sufficient "resolution".

Then what you do is play your simulation, however in between each "step" you get the distance between the current step pos and the previous step pos and add this to "TotalDistance"

Then...

If TotalDistance > YourGapSize
Add a new sampled point
TotalDistance = 0
End If

The result is that you have a new list of sampled points, all an equal distance from each other. This ideal if you are using splines of any kind for an editor but require regular and stable data.