8
edits
| Luanbo.Zhang (talk | contribs)  | |||
| Line 457: | Line 457: | ||
| ===Rotating Rect=== | ===Rotating Rect=== | ||
| [[File:rect1.jpg|250px]] [[File:rect2.jpg|250px]] [[File:rect3.jpg|250px]] | [[File:rect1.jpg|250px]] [[File:rect2.jpg|250px]] [[File:rect3.jpg|250px]] | ||
| ==== | ==== XIANZHI ZHANG==== | ||
| float rotationVal = 0.00; | float rotationVal = 0.00; | ||
| Line 499: | Line 499: | ||
|    rect(0, 0, 40, 40, 6+S); |    rect(0, 0, 40, 40, 6+S); | ||
|    rotationVal += 0.01; |    rotationVal += 0.01; | ||
| } | |||
| ====HAIN-RUEY CHAN==== | |||
| float rotationVal = 0.00; | |||
| void setup(){ | |||
|   size(700, 700); | |||
|   rectMode(CENTER); | |||
|   frameRate(20); | |||
|   noFill(); | |||
|   strokeWeight(3); | |||
|   smooth(); | |||
| } | |||
| void mousePressed() { | |||
|   noLoop(); | |||
| } | |||
| void mouseReleased() { | |||
|   loop(); | |||
| } | |||
| void draw(){ | |||
|   background(0); | |||
|   translate(width * 0.5, height * 0.5); | |||
|   float dim = mouseX; | |||
|   stroke(192,255,62); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*0.1, dim*0.1); | |||
|   stroke(0,255,127); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*0.3, dim*0.3); | |||
|   stroke(127,255,0); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*0.5, dim*0.5); | |||
|   stroke(0,238,0); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*0.7, dim*0.7); | |||
|   stroke(179,238,58); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*0.9, dim*0.9); | |||
|   stroke(202,255,112); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*1.1, dim*1.1); | |||
|   stroke(0,238,118); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*1.3, dim*1.3); | |||
|   stroke(154,205,50); | |||
|   rotate( rotationVal ); | |||
|   rect(0, 0, dim*1.5, dim*1.5); | |||
|   rotationVal -= 0.007; | |||
| } | |||
| ====Luanbo Zhang==== | |||
| float rotationVal = 0; | |||
| int distance = 0; | |||
| void setup(){ | |||
|   size(1000, 1000); | |||
|   rectMode(CENTER); | |||
|   frameRate(25); | |||
|   smooth(); | |||
| } | |||
| void mousePressed(){ | |||
|   // when mouse is pressed, the pattern will become bigger | |||
|   distance = 150 ; | |||
| } | |||
| void mouseReleased(){ | |||
|   distance = 0; | |||
| } | |||
| void draw(){ | |||
|   int x = mouseX; | |||
|   int y = mouseY-500; | |||
|   int scale = distance + y; | |||
|   //with mouseY change the scale | |||
|   float a = random(-500, 500); | |||
|   float b = random(-500, 500); | |||
|   rotationVal += 0.0001 * x; | |||
|   //with mouseX change the speed of rotation  | |||
|   background(40,60,110); | |||
|   translate(width * 0.5, height * 0.5); | |||
|   //mouse effect | |||
|   stroke(180, 180, 0); | |||
|   line(mouseX-500, mouseY-500, pmouseX-500, pmouseY-500); | |||
|   //shining stars in background | |||
|   fill(180,180,0); | |||
|   ellipse(a, b, 5, 5); | |||
|   ellipse(b, a, 2, 2); | |||
|   //squares | |||
|   noStroke(); | |||
|   fill(255, 80, 80); | |||
|   rotate( 1 * rotationVal ); | |||
|   //clockwise | |||
|   rect(0, 0, 452 + scale, 452 + scale, 20); | |||
|   fill(255, 128, 20); | |||
|   rotate( -2 * rotationVal ); | |||
|   //anticlockwise | |||
|   rect(0, 0, 320 + 0.8 * scale, 320 + 0.8 * scale, 18); | |||
|   fill(255,215,30); | |||
|   rotate( 2 * rotationVal ); | |||
|   rect(0, 0, 226 + 0.6 * scale, 226 + 0.6 * scale, 16); | |||
|   fill(124,200 ,0); | |||
|   rotate( -2 *rotationVal ); | |||
|   rect(0, 0, 160 + 0.4 * scale, 160 + 0.4 * scale, 14); | |||
|   fill(64, 200, 180); | |||
|   rotate( 2 * rotationVal ); | |||
|   rect(0, 0, 113 + 0.2 * scale, 113 + 0.2 * scale, 12); | |||
|   fill(30, 144, 230); | |||
|   rotate( -2 * rotationVal ); | |||
|   rect(0, 0, 80 + 0.1 * scale, 80 + 0.1 * scale, 10); | |||
|   fill(65, 105, 200); | |||
|   rotate( 2 * rotationVal ); | |||
|   rect(0, 0, 57, 57, 8); | |||
|   fill(123, 104, 230); | |||
|   rotate( -2 * rotationVal ); | |||
|   rect(0, 0, 40, 40, 6); | |||
| } | } | ||
edits