Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PVector position;
- PShape circle;
- float x,y;
- int count;
- int tall;
- int count2;
- float start;
- float stop ;
- float vinkel ;
- void setup() {
- fullScreen();
- noFill();
- stroke(255,255,255,30);
- strokeWeight(2);
- count = 0;
- background(0);
- tall =10;
- count2= 0;
- start = 0;
- stop = 2*PI;
- vinkel = 0;
- }
- void draw() {
- if (count > tall){
- background(0);
- count = 0;
- tall = (int)random(1,100);
- print("hei");
- }
- count = count +1;
- translate(width/2, height/2);
- rotate(vinkel);
- beginShape();
- for (float theta =start; theta <= stop; theta +=0.01){
- float rad =r(theta,
- mouseY/200.0, //a
- mouseX/400.0, //b
- 5, //m
- 1, //n1
- 1, //n2
- 2 //n3
- );
- float x = rad*cos(theta)* 50;
- float y = rad*sin(theta)* 50;
- vertex(x,y);
- }
- for (float theta =start; theta <= stop; theta +=0.01){
- float rad =r(theta,
- 1.2*mouseY/200.0, //a
- 1.2*mouseX/400.0, //b
- 5, //m
- 1, //n1
- 1, //n2
- 2 //n3
- );
- float x = rad*cos(theta)* 50;
- float y = rad*sin(theta)* 50;
- vertex(x,y);
- }
- for (float theta =start; theta <= stop; theta +=0.01){
- float rad =r(theta,
- 1.4*mouseY/200.0, //a
- 1.4*mouseX/400.0, //b
- 5, //m
- 1, //n1
- 1, //n2
- 2 //n3
- );
- float x = rad*cos(theta)* 50;
- float y = rad*sin(theta)* 50;
- vertex(x,y);
- }
- endShape();
- start += 0.1;
- stop += 0.1;
- vinkel +=0.003;
- }
- float r(float theta, float a, float b, float m, float n1, float n2, float n3) {
- return pow(pow(abs(cos(m*theta/4.0)/a),n2)+pow(abs(sin(m*theta/4.0)/b),n3),-1/n1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement