Self Portrait and Drawing Machine

In this project, I made a simple drawing machine. In this machine, main icon is two red circles connected by a line. This icon can turn by itself, the rotating center is the middle point of the line. When you move the mouse on the screen, the icon will move with the mouse and continually rotate. In addition, the color of background will turn lighter as time goes on.

Here is the code:

float a = 50.0; //

void setup() { 
size(500,500); 
smooth(); 
background(10,186,181); 
colorMode(HSB,0,128,128); 
} 

void draw() { 
fill(0,0,70,3); 
rect(0,0,500,500); 
a += 0.1; //
translate(mouseX,mouseY); // 
rotate(a); 
fill(random(360),100,100); 
line(-45,0,45,0); 
ellipse(-45,0,8,8); 
ellipse(45,0,8,8); 
}

ima

 

I used the drawing machine designed in class. It’s like a simple painting pen. Here is the picture.

Self Portrait

 

Leave a Reply