Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.hamoid.*;
- import peasy.*;
- import peasy.org.apache.commons.math.*;
- import peasy.org.apache.commons.math.geometry.*;
- color bg, f;
- float theta;
- int frms = 500;
- long rs;
- color black = color(34, 34, 34); // #222222
- color white = color(238, 238, 238); // #EEEEEE
- color red = color(225, 76, 69); // #E14C45
- PeasyCam cam;
- VideoExport videoExport;
- void setup() {
- size(1080, 720, P3D);
- smooth(8);
- background(0);
- bg = #eeeeee; // #222222;
- f = #764f6f; //#eeeeee;
- rs = (long) random(9999);
- cam = new PeasyCam(this, width/2, height/2, 0, 1300);
- cam.setMinimumDistance(50);
- cam.setMaximumDistance(1500);
- ///*
- videoExport = new VideoExport(this, "internetVideo.mp4");
- videoExport.setFrameRate(30);
- videoExport.setQuality(85, 128);
- videoExport.startMovie();
- frameRate(30);
- curveDetail(40);
- }
- void draw() {
- background(black);
- randomSeed(rs);
- lights();
- translate(width/2, height/2);
- pushMatrix();
- rotateY(theta);
- println(frameRate);
- int num = 75;
- for (int i=0; i<num; i++) {
- //noFill();
- fill(white);
- if (random(1)>0.9) fill(red);
- stroke(black, 100);
- float p[] = new float[12];
- for (int j=0; j<p.length; j++) {
- p[j] = random(-400,400);
- }
- curve(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11]);
- }
- popMatrix();
- //videoExport.saveFrame();
- //if (frameCount<=frms) saveFrame("image-####.gif");
- if (frameCount<=frms) videoExport.saveFrame();
- if (frameCount>frms) videoExport.endMovie();
- theta += TWO_PI/frms;
- }
- void keyPressed() {
- if (key == 'q') {
- videoExport.endMovie();
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement