Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2010-05-27 02:54:16

safra
Member
Registered: 2005-12-03
Posts: 41

spline formulas

Hi,

I currently use a  Catmull–Rom type of spline formula in a 3D world to interpolate between control points. I had like to be able to insert control points exactly on the spline for more detail on the y-axis. I found that this results into a nasty bending on the x,z axis as well. Anyone knows of a spline formula that will allow me to do this which will keep the curve shape on the x,z axis the same? Or perhaps is there way to use the catmull-Rom formula for this by using a specific "tension" value?

Any help much appreciated!

Regards,
Raoul

Offline

#2 2010-05-27 03:35:45

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: spline formulas

Hi safra;

Not very familiar with that type of spline. So I am asking you a question. Wouldn't you have to recompute the spline again with the new control points?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2010-05-27 09:53:20

safra
Member
Registered: 2005-12-03
Posts: 41

Re: spline formulas

Hi bobbym,

Yes, that is the idea, recalculate the spline using the new control points. The x,z shape should stay the same as the new control point is located exactly on the existing spline curve.

Offline

#4 2010-05-27 13:20:45

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: spline formulas

Hi;

Again, I am learning from you. When you recalculated the spline. Did it pass through all the control points like it is supposed to?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2010-05-28 00:16:16

safra
Member
Registered: 2005-12-03
Posts: 41

Re: spline formulas

Thanks for replying bobbym!

Yes, it does pass through all control points. The formula I use calculates the curve between 2 control points by using 2 outer control points. So each curve between 2 control points is based on the position of 4 control points. That said, inserting a control point (even if exactly on the current spline shape) will lead to a different shape! Something I do not want to happen.

Offline

#6 2010-05-28 01:55:46

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: spline formulas

Hi safra;

Don't thank me, actually you have told me more than I have told you. Is that usual that adding 1 more point changes the output? Is it a large change?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#7 2010-05-28 20:42:18

safra
Member
Registered: 2005-12-03
Posts: 41

Re: spline formulas

It is a small change yet very noticable.

Offline

#8 2010-05-28 20:52:56

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: spline formulas

Hi safra;

If you are sure that your spline fitting is correct. And I have no reason to believe that you are making an error there. That change might be unavoidable. It is not unusual when adding more points to any interpolation for extra features of the curve to be revealed. I think that is what is happening to you.

I am not saying grin and bear it but a curve that is sampled by a small number of points might look very different when sampled by just a few more.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB