Today, while experimenting, I developed a method which allows you to draw super smooth lines . This is basically an improved version of a project by @CreationsOfaNoob from several months ago.
This technique is free to use
You can find the drawing pad here:
…and the original project here:
…and the original colored version here:
In the project, you will see that any drawn lines are extremely smooth, with no visible cuts or anything. Lines also change size depending on how fast you are moving your finger, and this is also smooth.
In order to accomplish this, I am actually drawing several trails every frame, which form a curve (more specifically, a Bézier curve). I’ve done this in such a way that the curves combine seamlessly into one long trail.
A more technical breakdown:
First of all, I have a touch tracker. This object keeps track of when the user is pressing the screen, as well as figuring how how fast the user is moving their finger.
Then, there are the 4 “Touch followers”. The first touch follows the current touch, but a bit of smoothing is applied, for a smoother curve. The second touch follower follows the first one such that it is where the first touch follower was, exactly one frame before. The 3rd touch follower follows the second in the same way, and the same is true with the 4th.
Then, there are the control points. They serve as the control points for the drawing object, which draws the Bézier curve. They are positioned in such a way that the curve is smooth, and has no sudden turns.
Finally, we have the drawing object. It creates several clones (the amount can be changed), and each one draws a section of each Bézier curve. They draw a new curve every frame, using some neat tricks.
If you want to see the code behind this, feel free to look at the project.