OZONE Asylum
Forums
OZONE
Calculating points along a curve
This page's ID:
28706
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
A curve described by a list of points is called a Spline. There are a lot of ways to create a spline from a list of points, the simplest being a straight line from each point to the next. More complicated spline representations can be smooth. My personal favorite is the "natural cubic spline." As with most splines, you represent the curve as a function on a variable t. As t goes from 0 to 1, the function f(t) goes from the first point to the second point. As t goes higher, it goes to each successive point. To make this work in 2 or 3 dimensions, we actually have a separate function for each dimension. In reality, we use a separate function for each segment. To enforce smoothness at each point, we require that the first and second derivatives of these functions match at their endpoints. The details are described here: http://mathworld.wolfram.com/CubicSpline.html Actually implementing this is pretty difficult, because once you create the matrix from the points you need to solve it. (Not impossible to implement, just time consuming.) It's best if you can find an external library that does all this for you. Once you have the function, you can get as many points from it as you want by plugging in different values of t. The POV-Ray scripting language can do what you want, and it's capable of outputting CSV files, if that's useful to you.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »