BASIC

Author Topic: Bezier curves / Splines - through points  (Read 78 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10637
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
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.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4084
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Bezier curves / Splines - through points
« Reply #1 on: 2017-Jul-21 »
That might come in very handy at some point. Cheers Gernot. Nice to see you about BTW :)
I came. I saw. I played.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4001
    • View Profile
    • Portfolio
Re: Bezier curves / Splines - through points
« Reply #2 on: 2017-Jul-28 »
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! :)