Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float t;
- PShape curve;
- void setup(){
- size(600,600);
- t = 0.0;
- }
- void draw(){
- background(0);
- curve = createShape();
- curve.beginShape();
- curve.fill(255);
- curve.noStroke();
- float theta = 0;
- while (theta < TWO_PI){
- float r = funct(theta, t);
- float x = r * cos(theta);
- float y = r * sin(theta);
- x = map(x,-2,2,0,width);
- y = map(y,-2,2,height,0);
- curve.vertex(x,y);
- theta += TWO_PI/200;
- }
- curve.endShape(CLOSE);
- shape(curve,0,0);
- t += 0.2/400;
- //saveFrame("./data/frame#####.tif");
- if (t > 0.2){
- //println("done capturing");
- //exit();
- t = 0;
- }
- }
- float funct(float theta, float t){
- return 1 + t * sin(7*theta);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement