3D円形模様
float angle = 0; void setup() { size(1000, 1000, P3D); colorMode(HSB, 360, 100, 100, 100); } void draw() { background(255); translate(width/2, height/2); rotateY(radians(angle)); rotateX(radians(angle)); angle += 0.5; enkeiMethod(0, 0); rotateY(radians(30)); enkeiMethod2(0, 0); rotateY(radians(30)); enkeiMethod3(0, 0); rotateY(radians(30)); enkeiMethod3(0, 0); rotateY(radians(30)); roseCurve(0,0, 360); } void enkeiMethod(float x, float y) { pushMatrix(); //現時点の座標系を保存 translate(x, y); float size = 50; for (int i= 0; i< 36; i++) { stroke(100, 100, 100, 50); fill(50, 100, 100, 50); rect(size, size, 10, 10); rotate(radians(10)); } popMatrix(); //保存した座標系に戻す } void enkeiMethod2(float x, float y) { } void enkeiMethod3(float x, float y) { } void roseCurve(float cx, float cy, int loop) { } void keyPressed() { if (keyCode == ENTER) { saveFrame("image-####.png"); } }
Copy