Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (28 sloc) 574 Bytes
void setup() {
size(960, 540);
pixelDensity(displayDensity());
rectMode(CENTER);
stroke(0);
strokeWeight(5);
fill(128);
}
void draw() {
background(255);
// 時計周りに回転する正方形
pushMatrix();
translate(width/2-100, height/2);
rotate(frameCount*0.05);
rect(0, 0, 100, 100);
popMatrix();
// 反時計回りに回転する正方形
pushMatrix();
translate(width/2+100, height/2);
rotate(-frameCount*0.05);
rect(0, 0, 100, 100);
popMatrix();
}
void keyPressed() {
if (key == 's') {
saveFrame("sketch12.jpg");
}
}