Easing help
in
Programming Questions
•
1 year ago
Good night everyone!!!!
I'm new in this awesome programming language and for that reason some people recommended me that read the book "Getting started with processing", all very well up here, but come to a section named easing, here is the problem. In the book is an example of how to draw a line with this technique but i don´t know how the the process flows, i don´t know if the process of the "x" variable needs to finish to continue the next process ("y" variable). Below is the code:
float x;
float y;
float px;
float py;
float easing = 0.05;
void setup() {
size(480, 120);
smooth();
stroke(0, 102);
}
void draw() {
float targetX = mouseX;
x += (targetX - x) * easing; //here i need to know the flow of the process
float targetY = mouseY;
y += (targetY - y) * easing;
float weight = dist(x, y, px, py);
strokeWeight(weight);
line(x, y, px, py);
py = y;
px = x;
}
Please I need your help to continue learning
Regards
1