Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sz, z=0, num=120;
- float[] offSet = new float[num];
- float theta, scal, inc;
- color[] palette = {#69D2E7, #A7DBD8, #E0E4CC, #F38630, #FA6900};
- void setup() {
- size(1000, 800, P3D);
- rectMode(CENTER);
- theta = PI;
- for (int i=0; i<num; i++) {
- inc += (TWO_PI/num);
- offSet[i] = inc;
- }
- }
- void draw() {
- background(20);
- sz = 500;
- for (int i=0; i<num; i++) {
- pushMatrix();
- translate(width/2, height/2,z);
- rotateX(offSet[i]+theta*0.1);
- rotateY(offSet[i]+theta*0.125);
- rotateZ(offSet[i]+theta*0.05);
- sz -= 3;
- scal = map(sin(offSet[i]*3+theta),-1,1,0.2,.8);
- fill(palette[i%5],150);
- strokeWeight(2*scal);
- box(sz*scal);
- popMatrix();
- }
- theta += 0.0523;
- }
- void keyPressed() {
- save(random(2323)+".tif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement