Advertisement
xeromino

x

Dec 3rd, 2015
433
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 = "darkgrey";
  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 = 4;
  22.     for (var j=0; j<parts; j++) {
  23.         for (var i=0; i<num; i++) {
  24.             var d = 50/num*i,
  25.                 s = 10-10/num*i,
  26.                 slice = 360/parts*j
  27.                 px = width/2 + Math.cos(Math.PI*2/parts*j)*25,
  28.                 py = height/2 + Math.sin(Math.PI*2/parts*j)*25    ;
  29.             list.addCircle({
  30.                 x: px,
  31.                 y: py,
  32.                 rotation: -45,
  33.                 startAngle: [90*j-s, 90*j+s],
  34.                 endAngle: [90*(j+1)-s,90*(j+1)+s],
  35.                 radius: 200-200.0/num*i,
  36.                 stroke: true,
  37.                 strokeStyle: "rgba(255,255,255,.75)",
  38.                 lineWidth: .5,
  39.                 fillStyle: color.gray(0),
  40.                 phase: i/num,
  41.                 drawFromCenter: true
  42.             });
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement