ofxMSAInterpolator (2009)

 

Example usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// declare an Interpolator of ofVec3f (3d vector)
msa::Interpolator<ofVec3f> interpolator
//msa::Interpolator3D interpolator; // msa::Interpolator3D is the same as msa::Interpolator<ofVec3f>

// add some data (API is similar to std::vector)
for(int i=0; i<numPoints; i++) {
   ofVec3f v = getVertex(i); // assume getVertex() is a function that provides vertex positions
   interpolator.push_back(v);
}

// resample in 1% increments, loop through and draw
float spacing = 0.01;
glBegin(GL_LINE_STRIP);
for(float f=0; f<=1; f+= spacing) {
   ofxVec3f v = interpolator.sampleAt(f);
   glVertex3f(v.x, v.y, v.z);
}
glEnd();

A set of C++ template classes for doing various types of interpolations on data with any number of dimensions.

You can feed the system an arbitrary number of n-dimensional data (data can be simple types like float, int or complex types like vectors or even matrices, custom structs, classes like biped poses etc), then resample at any resolution, or ask for the interpolated value (linear or cubic) at any point.

Download

github.com/memo/ofxMSAInterpolator

License

Released under theĀ MIT License