Interpolating Bezier Spline Curve DEMO
-
It was noted by some users that the Fuze
Bezier()
function only takes 4 points and doesn't even go through the middle ones. This is because the middle points in a Bezier curve control the tangent to the curve at the endpoints. The curve is only guaranteed to pass through the endpoints.However it is not difficult to stitch together a 'spline' curve from multiple Bezier curves that pass through every input point.
- You can have as many input points as you like (minimum 2)
- The curve will pass though (interpolate) every point
- The path will have a continuous tangent everywhere (eg be smooth)
To demonstrate this I have created a small program that has interactive curve editing and a missile following the curve.
Bezier Spline DEMO
ID:QDK63MND9L
-
I'll check this out, thank you!
-
@Gothon this is so cool what an awesome demo !
-
This is a nicely-editable curve! The missile even follows along while you’re moving the points :)
-
I have now added an option to connect the ends of the curve together creating closed loop that the missile can follow endlessly.
-
Nice job, @Gothon !
-
Yesterday I was running the KatRacer demo and I thought that I could use a spline curve to describe the path of the race track. So I added some code from my demo and started placing control points by trial and error. Some hours later with only 16 control points I was able to pretty accurately path out the entire track.
With this track information I was able to confine the kart to the track. It is not perfect, but it is pretty close. With this information it should be possible to flesh out a racing game for any one who wants to just as Jon originally intended. :-) Kat made two other tracks if anyone wants to make a spline for those as-well.
Kat Racer - Track Spline
ID:1RV23MND9L
(live) -
It seems like fuze is maturing. I was having a look through my downloaded stuff the other day and there’s allsorts of stuff to mess about with. Your file system, 3d collision/physics helper functions, a high score table, not to mention all the game jam stuff. Now the old demos are coming back. Good times!
Edit: And the particles!