Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float radio;
- float tablaDel = 0;
- int x = 255;
- void setup(){
- size(640,640);
- radio = width/2 - 16;
- colorMode(HSB, 360, 100, 100);
- textAlign(CENTER, CENTER);
- textSize(20);
- }
- PVector crearVector(float indice, float total){
- float angle = map(indice % total, 0, total, 0, TWO_PI);
- PVector v = PVector.fromAngle(angle + PI);
- v.mult(radio);
- return v;
- }
- void draw(){
- background(0);
- fill(255);
- text("Tabla del\n" + nfc(tablaDel,2),55,40);
- x--;
- if(x==0)x=360;
- println(x);
- int total = int(map(mouseX,0, width, 0, 200));
- tablaDel += 0.008;
- translate(width/2, height/2);
- stroke(x, 255, 255);
- noFill();
- circle(0,0,radio*2);
- for(int i = 0; i < total; i++){
- PVector v = crearVector(i,total);
- fill(255);
- circle(v.x, v.y, 8);
- }
- for(int i = 0; i < total; i++){
- PVector a = crearVector(i,total);
- PVector b = crearVector(i * tablaDel,total);
- line(a.x,a.y,b.x,b.y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement