Say if we have two eyes, how would we use PVector to make the pupils follow the mouse

edited May 2016 in How To...

So i want to make the pupils follow the mouse while the mouse is over each eye and then each pupil be constrained to each eye. I know this can be done using PVectors but im not sure how to?

Tagged:

Answers

  • Start with something simple. Can you draw a line from (0,0) to the mouse's position? How about a line from the middle of the sketch to the mouse's position?

  • edited May 2016

    mouseX/20+(width/2),mouseY/20+(height/2)

Sign In or Register to comment.