Tuesday, April 03, 2012
Theyre Watching You!
//example taken from
//processingjs.org/learning/basic/arctangent/
int e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11;
void setup()
{
size(500, 500);
smooth();
noStroke();
e1 = new Eye( 250, 250, 80);
e2 = new Eye( 64, 85, 40);
e3 = new Eye( 90, 200, 120);
e4 = new Eye(150, 44, 40);
e5 = new Eye(175, 120, 80);
e6 = new Eye(340, 126, 170);
e7 = new Eye(50, 400, 100);
e8 = new Eye(246, 428, 111);
e9 = new Eye(400, 350, 90);
e10 = new Eye(165, 325, 70);
e11 = new Eye(465, 465, 55);
//size and position of the "eye"
}
void draw()
{
background(0,0,0);
e1.update(mouseX, mouseY);
e2.update(mouseX, mouseY);
e3.update(mouseX, mouseY);
e4.update(mouseX, mouseY);
e5.update(mouseX, mouseY);
e6.update(mouseX, mouseY);
e7.update(mouseX, mouseY);
e8.update(mouseX, mouseY);
e9.update(mouseX, mouseY);
e10.update(mouseX, mouseY);
e11.update(mouseX, mouseY);
//follows the mouse around the screen
e1.display();
e2.display();
e3.display();
e4.display();
e5.display();
e6.display();
e7.display();
e8.display();
e9.display();
e10.display();
e11.display();
}
class Eye
{
int ex, ey;
int size;
float angle = 0.0;
Eye(int x, int y, int s) {
ex = x;
ey = y;
size = s;
}
void update(int mx, int my) {
angle = atan2(my-ey, mx-ex);
}
void display() {
pushMatrix();
translate(ex, ey);
fill(255,255,255);
//"iris"
ellipse(0, 0, size, size);
rotate(angle);
//rotation
fill(255,0,0);
//"pupil"
ellipse(size/4, 0, size/2, size/2);
popMatrix();
}
}
//processingjs.org/learning/basic/arctangent/
int e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11;
void setup()
{
size(500, 500);
smooth();
noStroke();
e1 = new Eye( 250, 250, 80);
e2 = new Eye( 64, 85, 40);
e3 = new Eye( 90, 200, 120);
e4 = new Eye(150, 44, 40);
e5 = new Eye(175, 120, 80);
e6 = new Eye(340, 126, 170);
e7 = new Eye(50, 400, 100);
e8 = new Eye(246, 428, 111);
e9 = new Eye(400, 350, 90);
e10 = new Eye(165, 325, 70);
e11 = new Eye(465, 465, 55);
//size and position of the "eye"
}
void draw()
{
background(0,0,0);
e1.update(mouseX, mouseY);
e2.update(mouseX, mouseY);
e3.update(mouseX, mouseY);
e4.update(mouseX, mouseY);
e5.update(mouseX, mouseY);
e6.update(mouseX, mouseY);
e7.update(mouseX, mouseY);
e8.update(mouseX, mouseY);
e9.update(mouseX, mouseY);
e10.update(mouseX, mouseY);
e11.update(mouseX, mouseY);
//follows the mouse around the screen
e1.display();
e2.display();
e3.display();
e4.display();
e5.display();
e6.display();
e7.display();
e8.display();
e9.display();
e10.display();
e11.display();
}
class Eye
{
int ex, ey;
int size;
float angle = 0.0;
Eye(int x, int y, int s) {
ex = x;
ey = y;
size = s;
}
void update(int mx, int my) {
angle = atan2(my-ey, mx-ex);
}
void display() {
pushMatrix();
translate(ex, ey);
fill(255,255,255);
//"iris"
ellipse(0, 0, size, size);
rotate(angle);
//rotation
fill(255,0,0);
//"pupil"
ellipse(size/4, 0, size/2, size/2);
popMatrix();
}
}
info
submitted by: Demitchimoviews: 1231
Theres no where to run, theres no where to hide, the eyes will always be watching you!
comments
loading...
Add a comment: