Bezier Curves & Easing Functions
I recently watched a video by Sebastian Lague in which he went back and answered a number of viewer questions. It was a great video, however it got me interested in some animation and graphics related topics again which I’d looked into a little a few years ago. I started looking a little more into bezier curves, basic animation, and easing functions, and found that they were a lot simpler than I imagined.
I decided to try messing with them and decided to just throw some code together in Python. It was relatively quick and easy. I looked up the equations for some basic easing functions, checked how to do linear interpolation, and got to work using pygame as it’s nice and easy for quick prototyping.
All of the code was relatively simple, if a little messy, and I was able to get basic easing functions and animation done in an hour or two. I then spent a little time working on bezier curve generation. I found it was actually very simple and had it working within a very short space of time.
Overall it was a very fun little project, and I plan on looking into doing similar projects in future. I’ve included a couple of videos of the project in use below.
A small demonstration of the bezier point dragging in the project.
The easing function switching built into the program (controlled with left and right arrows).