# Calculating parameter for each point on a Catmull-Rom Spline

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

## Recommended Posts

On the wiki page we have this equation for interpolating between two spline control points, where the parameter t is normalized in the range [0,1]:

That's fine. But, to use it generally we need to be able to assign a parameter value t[sub]k[/sub] to each control point p[sub]k[/sub], so that when interpolating at any point along the spline we can choose which section to use, and how to normalize t into the 0,1 range for that section.

How can we calculate tk correctly without knowing the spline length, which in turn requires knowing the spline equations first?! Maybe the wiki article covers it, but the notation got too confusing for me!

##### Share on other sites
[color=#000000][font=sans-serif]

## t = 1[/font][/quote] I think it tries to say when t=0 your spline will be at p[sub]0, while t=1 results in [/sub]p[sub]1. Basically t is interpolation variable between two points.[/sub] [color=#000000][font=sans-serif]Using all values between (0; 1) you'll get infinite amount of points which form your spline. Therefore you can choose 10, 40, 100 or milliion points, depending on quality you need.[/font] [color=#000000][font=sans-serif]Sorry about font weirdness, editor is really stupid.[/font]

##### Share on other sites
This might be of help to you.

I have catmul rom and bezier demo's here.

Both have runnable .exe's and Blitzbasic source code.

Both allow for constant or non constant motion along the spline. Using the differential of the spline.

1mb

http://www.trinosis....source_code.zip

KJM

##### Share on other sites
Ok so... You can have two situations: 1) you have the points in space (say 3D) with their parameter values preassigned 2) you have just the points in space.

In the first case the situation is straight forward - you just proceed as the article says, that is for each parameter interval you normalize it to (0,1) and the use the formula you posted.

In the second case you need to parametrize the data and there is no "one way" of doing it as different metods give different results. Try to google for "uniform parametrisation", "chord lenght parametrisation" and "centipetal parametrisation".

##### Share on other sites

Ok so... You can have two situations: 1) you have the points in space (say 3D) with their parameter values preassigned 2) you have just the points in space.

In the first case the situation is straight forward - you just proceed as the article says, that is for each parameter interval you normalize it to (0,1) and the use the formula you posted.

In the second case you need to parametrize the data and there is no "one way" of doing it as different metods give different results. Try to google for "uniform parametrisation", "chord lenght parametrisation" and "centipetal parametrisation".
Yes it's the 2nd case, I just define spline as set of 3D points. So I'm correct to be a bit confused, it seems

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

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

• Total Topics
633769
• Total Posts
3013758
×