90
edits
| Line 171: | Line 171: | ||
| OPTION 1 | |||
| void setup () { | void setup () { | ||
| Line 192: | Line 193: | ||
| rect(i,i,30,30); | rect(i,i,30,30); | ||
| fill(random(255),random(255),random(255), 150); | fill(random(255),random(255),random(255), 150); | ||
| } | |||
| popMatrix(); | |||
| } | |||
| OPTION 2 | |||
| void setup () { | |||
|  size (800,600); //(displayWidth,displayHeight); | |||
| } | |||
| void draw (){ | |||
|    background (255); | |||
|   translate (width * 0.08, height * 0.08 ); | |||
|   element1 (); | |||
|   translate (width * 0.25, height * 0.25 ); | |||
|     element2 (); | |||
|     translate (width * 0.25, height * 0.25 ); | |||
|     element1 (); | |||
|  translate (width * 0.25, height * 0.25 ); | |||
|     element2 (); | |||
| } | |||
| void element1 () { | |||
|   frameRate(4); | |||
|  stroke(0); | |||
| pushMatrix(); | |||
| for(int i= 1; i < width/5; i++){ | |||
| rotate(mouseX * 0.001); | |||
| ellipse(i,i,20,20); | |||
| fill(0,150); | |||
| } | |||
| popMatrix(); | |||
| } | |||
| void element2 () { | |||
|   frameRate(4); | |||
|  stroke(0); | |||
| pushMatrix(); | |||
| for(int i= 2; i < width/2; i++){ | |||
| rotate(-mouseY * 0.001); | |||
| rect(i,i,10,10); | |||
| fill(0, 150); | |||
| } | } | ||
| popMatrix(); | popMatrix(); | ||
edits