We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi again!
Is there a way with this code to easing with constant speed?
float x;
float y;
float easing = 0.05;
void setup() {
size(640, 360);
noStroke();
}
void draw() {
background(51);
float targetX = mouseX;
float dx = targetX - x;
x += dx * easing;
float targetY = mouseY;
float dy = targetY - y;
y += dy * easing;
ellipse(x, y, 66, 66);
}
thx!
Answers
What do you mean by easing with const. speed? The point of easing is not to have a constant speed.
ahh thx!
i mean that a ball follows a ball with constant speed. with easing the ball gets slower when the distance gets closer. i want the same speed all the time.
giCentre has a utility for easing, check if that helps.
Edit: So you need to remove easing instead?