Week 2 tutorial
Playing with colour, and experimenting with shape making.
- Show Sketch
/** @peep sketchcode */
void setup() {
size(255, 255);
frameRate(1); //one frame per second
}
void draw() {
noStroke();
// colorMode(RGB, 255, 255, 255);
for (int i = 0; i < 255; i++) {
for (int j = 0; j < 255; j++) {
stroke (i, j, 225);
point(i, j);
}
}
//Being prism
float x = random(255);
float y = random(255);
fill(255, 50);
strokeWeight(1);
stroke(0, 30);
beginShape(TRIANGLE_FAN);
vertex(random(255), random(255)); //centre vertex
vertex(x, 0); //top
vertex(255, y); //right
vertex(x, 255); //bottom
vertex(0, y); //left
vertex(x, 0); //top
endShape();
//noLoop();
}
Comments
Nobody has said anything yet.