#### Archived

This topic is now archived and is closed to further replies.

# 3D Curve Fitting

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

## Recommended Posts

there must be a very simple alogrithm for this, unfortunately I can not find it. I know about the 2d curve fitting alg. but either 1. I can''t figure out how to generalize it to 3-dimensions or 2. It can''t be done by these algorithms. So if I have a set of say 10 points that all have (x,y,z) how to I fit a curve so that it hits these points? thanks in advance..

##### Share on other sites
This might work...

Pick an independent variable, say z, preferably the axis with the greatest variation between extremes in the point set (axis in the directino of which the cloud of points is the longest).

Now fit curves for x = f(z) and y = g(z) just like you normally would in 2D.

Edit: This would work best for least-squares fitting, in which case you can have two or more of the same f(z) value for a given z in your set of points. If you don't know this to be the case, you probably can't fit an exact curve to the set of points. You would have the same problem in 2D fitting points that cannot all be described by a single function (ie. some of the domain maps to more than one point in the range. There's a fancy word for this that I forget.).

[edited by - Geoff the Medio on July 25, 2003 6:52:25 PM]

##### Share on other sites
Are you trying to fit splines or polynomials or what?

##### Share on other sites
have a look at the catmull rom splines

http://www.mvps.org/directx/articles/catmull/

##### Share on other sites
The Catmull-Rom Alg. seems like the right thing to fit a line (curve) between a set of points, when I want to hit all of the points.....I''m writing in opengl, but thanks for the link, I''ll see if I can figure it out.
Thanks..

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 12
• 19
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632662
• Total Posts
3007703
• ### Who's Online (See full list)

There are no registered users currently online

×