Advertisement
xeromino

col

Dec 4th, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     // glc.playOnce();
  4.     glc.size(540, 540);
  5.     glc.setDuration(1.5);
  6.     glc.setFPS(30);
  7.     glc.styles.backgroundColor = "#202020";
  8.     // glc.setMode("single");
  9.     // glc.setEasing(false);
  10.    
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h,
  14.             color = glc.color,
  15.             ox = width/2,
  16.             oy = height/2,
  17.             TWO_PI = Math.PI*2;
  18.  
  19.     // your code goes here:
  20.    
  21.     var num = 30, parts = 7;
  22.     for (var j=0; j<parts; j++) {
  23.         var f = 360.0/parts*j,
  24.             a = 360.0/parts;
  25.         for (var i=0; i<num; i++) {
  26.             var d = 15/num*i,
  27.                 s = 10/num*i,
  28.                 slice = 360/parts*j,
  29.                 px = width/2 + Math.cos(Math.PI*2/parts*j)*35,
  30.                 py = height/2 + Math.sin(Math.PI*2/parts*j)*35;
  31.             list.addCircle({
  32.                 x: px,
  33.                 y: py,
  34.                 rotation: -(360.0/parts)/2,
  35.                 startAngle: [a*j-s, a*j+s],
  36.                 endAngle: [a*(j+1)-s,a*(j+1)+s],
  37.                 radius: 200-200.0/num*i,
  38.                 stroke: true,
  39.                 strokeStyle: "rgba(20,20,20,.75)",
  40.                 lineWidth: .5,
  41.                 fillStyle: color.hsv(f,.9,.9),
  42.                 phase: i/num,
  43.                 drawFromCenter: true
  44.             });
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement