Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import peasy.*;
- import peasy.org.apache.commons.math.*;
- import peasy.org.apache.commons.math.geometry.*;
- PeasyCam cam;
- float theta;
- int num = 150;
- int frms = 200;
- void setup() {
- size(540, 540, P3D);
- smooth(8);
- background(0);
- cam = new PeasyCam(this, width/2, height/2, 0, 800);
- cam.setMinimumDistance(50);
- cam.setMaximumDistance(1000);
- }
- void draw() {
- background(#E9D3AF);
- strokeWeight(1);
- stroke(255, 15);
- lights();
- translate(width/2, height/2, -100);
- for (int i=0; i<num; i++) {
- float y = map(i, 0, num, -height*.65, height*.65);
- float offSet = TWO_PI/num*i;
- float boxSize = map(sin(theta+offSet*2), -1, 1, 30, 100);
- float x = map(sin(theta+offSet*1), -1, 1, -150, 150);
- pushMatrix();
- translate(x, y);
- fill(#41A3A3);
- stroke(#E9D3AF);
- noStroke();
- sphere(boxSize);
- popMatrix();
- }
- println(frameRate);
- //videoExport.saveFrame();
- if (frameCount<=frms) saveFrame("image-####.gif");
- theta += TWO_PI/frms;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement