Created
April 17, 2017 20:15
-
-
Save andyinabox/e15d7715d03e13dd0897bfe1cabc6d5f to your computer and use it in GitHub Desktop.
Follow point in Processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int h = 200; | |
PVector point; | |
PVector prev; | |
void setup() { | |
size(500, 500); | |
point = new PVector(mouseX, mouseY); | |
prev = point; | |
} | |
void draw() { | |
background(255); | |
point.x = point.x + (mouseX-point.x)/10; | |
point.y = point.y + (mouseY-point.y)/10; | |
line(mouseX, mouseY, point.x, point.y+h); | |
ellipse(mouseX, mouseY, 10, 10); | |
ellipse(point.x, point.y+h, 10, 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment