//designed to immitate the effect of a kaleidascope
//click to create different shapes
//ENTER to clear the screen
//kaleidascope-ish background
void setup() {
background(255);
size(400,400);
smooth();
strokeWeight(2);
beginShape();
fill(0);
stroke(255);
vertex(0,253);
vertex(47,52);
vertex(252,0);
vertex(400,143);
vertex(351,344);
vertex(154,400);
vertex(0,253);
endShape(CLOSE);
}
//circles when mouse is clicked
void draw() {
if (mousePressed==true) {
frameRate(5);
stroke(211,2,2,65);
fill(211,2,2,65);
ellipse(mouseX, mouseY,50,50);
stroke(84,22,129,45);
fill(84,22,129,45);
ellipse(mouseX-45, mouseY-45,65,35);
stroke(255,206,5,55);
fill(255,206,5,55);
ellipse(mouseX-70,mouseY-70,30,60);
//rectangles when the mouse is not clicked
}else{
frameRate(15);
stroke(5,132,255,45);
fill(5,132,255,45);
rect(mouseX, mouseY,4,2);
stroke(255,118,5,55);
fill(255,118,5,55);
rect(mouseX-45, mouseY-45,7,2);
stroke(255,5,185,65);
fill(255,5,185,65);
rect(mouseX-70,mouseY-70,8,5);
}
}
//to clear the screen
void keyPressed () {
if (key == ENTER) {
setup();
}
}
Jessica - E
on Tuesday, Oct 14, 2008 – 5:46 pm
2 Comments
Good idea. To get the true kaleidoscope, it would be better to use a technique like in Tiffany’s snowflake.
GOOOD project….i love the kaleidoscope! very cooool