Bèzier curves

click and drag the points around. space toggles between going by time or following your mouse x position (from 0 to 1, where left = 0 and right = 1)

project link

Very nice :slight_smile:

Would it be possible to make the green line movement a bit smoother? (just to add some polish to it)

thanks. i added a slider to change how many iterations it takes to draw the red line. the less the number the smoother the the animation should be, bigger number smoother curve.

or else, try opening it in the editor.

Its not the smoothness of the red line that I'm getting an issue with

It's that the green line "stutters" as it moves

If I reduce the slider to 6 - it reduces the stutter (might be there - might not - certainly very much reduced) but obviously the red line isn't at all smooth then

If your not seeing the effect then lets just put it down to my computer/OS/browser :slight_smile:

I am running it in the editor

hmm yeah;

I was thinking that too, ive put it up to 1000 when testing and was getting some lag, but that's obviously not necessary, I would think around 50 would be a good spot. I'm just curious because its not doing a too awfully lot and if I use this in the future I don't want any to re-iterate a poor script.

I cut down the red lines smoothness because that's where the bulk of the work is being done. each frame it draws the lines, which there's only about 5 I think but the curve it draws 100 or 50, or 'i' lines. it could be my math too, I'll check it out again later, i always plan on more optimizing anyways lol.

I love bezier curves!

working on higher order ones, should be really neat when done just got a few more touch ups

I've always been fascinated by Bèzier Curves.