132
edits
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
[[File:111.jpg|400px|]] | [[File:111.jpg|400px|]] | ||
Proccessing (figure moved by mouseX) | |||
void setup() { | |||
size(1000, 700); | |||
strokeWeight(3); | |||
smooth(); | |||
} | |||
void draw() { | |||
background(0); | |||
fill(174, 221, 60); | |||
ellipse(100, 580, 100, 100); | |||
ellipse(145, 580, 2, 2); | |||
ellipse(55, 580, 2, 2); | |||
ellipse(100, 535, 2, 2); | |||
ellipse(100, 625, 2, 2); | |||
ellipse(100, 580, 5, 5); | |||
float hourAngle = map(mouseX, 0, width, 0, 360); | |||
pushMatrix(); | |||
translate(100, 580); | |||
rotate(radians(hourAngle*12) - radians(90)); | |||
line(0, 0, 40, 0); | |||
float speed = dist(mouseX, mouseY, pmouseX, pmouseY); | |||
float diameter = speed * 2.0; | |||
fill(204, 221, 80); | |||
ellipse(50, 50, diameter/2, diameter/2); | |||
popMatrix(); | |||
translate(100, 580); | |||
rotate(radians(hourAngle) - radians(90)); | |||
line(0, 0, 20, 0); | |||
} |
edits