Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 50;
- float r;
- float theta;
- int ox, oy;
- color ccol = #000000;
- void setup() {
- size(400, 300);
- background(255);
- noFill();
- ox = width/2;
- oy = height/2;
- r = height/2.5;
- }
- void draw() {
- if (frameCount % 10 ==0 && frameCount < 201) {
- drawVCircle();
- saveFrame("line-####.gif");
- }
- }
- void drawVCircle() {
- stroke(ccol, 150);
- strokeWeight(random(1, 2));
- beginShape();
- for (int i=0; i < num; i++) {
- theta = random(TAU);
- //float over = random(20);
- float over = 0;
- float x = ox + over + sin(theta)*r;
- float y = oy + over + cos(theta)*r;
- vertex(x, y);
- }
- endShape();
- }
- void mouseClicked() {
- drawVCircle();
- }
- void keyPressed() {
- save(random(1234)+".jpg");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement