I’d like to generate lookup tables (actually, vectors) of ofPoints according to 3D parametric curves.
The underlying idea is : feeding ofPolyline with that in order to morph between polyline as @roymacdonald wrote in this thread : Smooth morphing between two ofPolyline?
but maybe there is a library (I didn’t find) doing the whole thing.
With parametric curves, I intend to generate knots-like path and other features “as if” these curves were … tubes. Some elements will travel all along the tubes.
the ofPolyline is actually just a container (vector) of ofPoints with a bunch of handy functions to create this points.
So, if you have your parametric math function for creating this points, instead of storing the points in a vector add them to the ofPolyline using the addVertex(ofPoint(…)) method.
What do you mean by “knot-like path”?
did you see this addon? https://github.com/kylemcdonald/ofxCurvesTool
do you know ofxaddons.com there might be other useful stuff.
Thanks for your answer.
At first I implemented the core parts of my code which provide me all room for testing quickly. (Still didn’t properly implement the morphing between polyline as I have to figure out some different ways to do that: decreasing or increasing resolution of polyline in order to make matching number of vertices and travel from one to other, using a kind of sorting algo for checking the closest pairs and morph etc)
About this parametric graphes like to polyline, ok for adding them directly in the polyline. It works fine like that as I clear it in update for reading it again at each turn. So it can be easily implemented.
My problem is more into parametric curves to ofpoints. I mean… It really depends on the resolution I want to use. This is finally a sampling “question”.
I think I have to use a loop with an index walking from first point to the latest. (Maybe doing that using lookup tables if I generate some curves using trigonometry like functions)