Bezier curves / Splines - through points

Previous topic - Next topic

Kitty Hello

With Hemlos' lib you can interpolate spline curves, if you know the control points. http://www.glbasic.com/forum/index.php?topic=3839.msg28012#msg28012
I continued this and will generate the control points for a polygonal line, so the curve touches all your input points in order.

See the example - just click points with your mouse, the spline will be generated interactively.

It's very useful to generate racing tracks or curves for cars that follow a route.

Ian Price

That might come in very handy at some point. Cheers Gernot. Nice to see you about BTW :)
I came. I saw. I played.

erico

Wait...who is this user? I better report it to the moderators! =D

Indeed, the code is superbly clean and small, a quick look and it seems even the likes of me can use it and there are many uses to put such into action. Great work!
I have plotted many far away from each points to check how the older points (till what level?) would conform, the result is really great! :)

MrPlow

Cool - will check this out - I did my  own beziers for one of my games...but a library is always handy!! :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

bigsofty

Very handy for baddie or camera movement patterns too. Great stuff!  :good:
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)