How to: Ease IN not out?
in
Programming Questions
•
2 years ago
Hi all,
I have a small question to ask. I've made this little code, all it does is follow the mouse around and ease out as it gets to a stop. My problem is I would like it to do the oposite and
EASE IN instead of ease out. Unfortunately I just cant get my head around the maths. Could anyone help me here?
float rectposX=0;
float rectposY=0;
void setup(){
size(500,500);
smooth();
}
void draw(){
rectposX = rectposX +(mouseX - rectposX)/10;
rectposY = rectposY +(mouseY - rectposY)/10;
background(50);
fill(255,255,0);
rect(rectposX,rectposY,20,20);
}
Many thanks in advance :)
1