Author Archives: yutongxue

Hello! My name is yutong, sophomore in communication design. I’m from China and came to the U.S. four years ago. Like most students, creative computing is totally new to me. I think it’s really fun and I’m excited to learn about it.

When I first started to play with some of the sketches in processing, I had no idea how things work. So I read the tutorials for processing online got to know some of the basic codes. And at the end, I made some basic sketches of my own.

This one has different colors of triangles coming out form the center and piling up. Once you click, everything will be cleared out and start all over again.

2013-09-12 08-09-51

http://www.openprocessing.org/sketch/109402

In this second one, there will be lines coming out wherever the mouse goes. Again, once you click, lines start all over. I did one that has only red lines and one that has all different colors of lines but setting the color to “random”.

picture of the color line one picture of the red line one

http://www.openprocessing.org/sketch/109393

http://www.openprocessing.org/sketch/109334

Here are the codes:

the first one:

Here’s the code:

void setup() {
size(360,360);
background(255);

}
void draw() {
noStroke();
fill(random(255),random(255),random(255),random(180));
triangle(180,180,random(0,360),random(0,360),random(0,360),random(0,360));
}
void mousePressed() {
background(255);
}

The second one:

void setup() {
size(360,360);
background(0);
noStroke();
fill(125);
triangle(150,130,210,130,180,180);
triangle(230,150,230,210,180,180);
triangle(180,180,130,150,130,210);
triangle(180,180,150,230,210,230);
}

void draw() {
stroke(random(250),random(250),random(250));
line(180,180,mouseX,mouseY);
//rect(mouseX,mouseY,30,30);
}

void mousePressed() {
background(0);
noStroke();
fill(125);
triangle(150,130,210,130,180,180);
triangle(230,150,230,210,180,180);
triangle(180,180,130,150,130,210);
triangle(180,180,150,230,210,230);
stroke(255);
//fill(47,34,242,180);
}