pulling interpolated values from shapes?

Is there a way to pull interpolated values from shapes draw in OpenGL?

Basically, I have a bezier spline and I want to write a function to query it’s values at certain points, which I would use with calls to the system clock to ofGetElapsedTimeMillis() to cycle through the curve in a specified duration and sample rate. If anyone’s used Max/MSP, think of [function] and [line~] except with bezier curves.

I can think of a few ways to tackle this problem offhand, for example cycling through pixel y values for a given x value using for loops or feeding the input to ofBezierVertex directly to interpolation algorithms and try to approximate the shape, but I’d rather defer to the more experienced as to what method will ultimately be the easiest and most efficient.

Also, I should mention that I have already tried Memo’s MSAInterpolator, but it’s not exactly what I’m looking for and I already have a good amount of my own code to build on.




the new ofPolyLine class is very good regarding the data fitting you would like to achieve. Check the member functions of the class and you will find the solution easily. Also there is an example project bundled.