3D円形模様
float angleX = 0; float angleY = 0; float angleZ = 0; void setup() { size(640, 480, P3D); fill(255, 255, 255); } void draw() { background(0); translate(width/2, height/2, 0); //rotateX(radians(angleX)); rotateY(radians(angleY)); rotateZ(radians(angleZ)); angleX += 1; angleY += 2; angleZ += 0.5; enkeiMethod(0, 0, 0); } void enkeiMethod(float x, float y, float z) { pushMatrix(); translate(x, y, z); for (int j = 0; j < 10; j++) { for (int i = 0; i < 10; i++) { rect(0, 0, 100, 50); rotateZ(radians(36)); } rotateY(radians(36)); } popMatrix(); }
Copy