Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 30;
- float offset, step;
- Linn[] lines = new Linn[num-2];
- color bg = #35263D;
- color q = #ABB785;
- void setup() {
- size(500, 500);
- background(bg);
- rectMode(CENTER);
- float y = 50;
- float theta = 0;
- step = (height-2*y)/num;
- println(step);
- for (int i=0; i<num-2; i++) {
- lines[i]= new Linn(int(y+step), theta);
- y += step;
- theta += TAU/num ;
- }
- }
- void draw() {
- background(bg);
- for (int i=0; i<lines.length; i++) {
- lines[i].display();
- }
- //if (frameCount % 4 == 0 && frameCount<121) saveFrame("image-####.gif");
- }
- class Linn {
- float offset, theta, y;
- Linn(float _y, float _theta) {
- y = _y;
- theta = _theta;
- }
- void display() {
- offset = map(sqrt(sin(theta)), -1, 1, 10, 120);
- fill(q,80);
- stroke(q);
- strokeWeight(2);
- //quad(width/2, y, width/2+offset, y, width/2, y+step, 50+(width/2-50)-offset, y+step);
- ellipse(width/2,y,offset, offset);
- theta -= 0.0523;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement