eriknau

25Days-24

Dec 24th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.      glc.loop();
  3. //     glc.size(400, 400);
  4.      glc.setDuration(5);
  5. //     glc.setFPS(20);
  6.      glc.setMode('single');
  7.      glc.setEasing(false);
  8.     glc.styles.backgroundColor = "black";
  9.    
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color;
  14.    
  15.     var container = list.addContainer({
  16.         x: width / 2,
  17.         y: height / 2,
  18.         rotation: [0, 360]
  19.     });
  20.    
  21.     var numBoxes = 30,
  22.         rad = 100;    
  23.  
  24.     for(var i = 0; i<numBoxes-2; i++) {
  25.         var newX = Math.cos(2 * Math.PI * i / numBoxes) * rad;
  26.         var newY = Math.sin(2 * Math.PI * i / numBoxes) * rad;
  27.         var rotator = list.addContainer({
  28.             parent: container,
  29.             x: newX,
  30.             y: newY,
  31.             rotation: [360,0]
  32.         })
  33.         var hue = Math.random()*30+200;
  34.         list.addIsobox({
  35.             parent: rotator,
  36.             x: 0,
  37.             y: 0,
  38.             colorTop: color.hsv(hue, 1, 1),
  39.             colorRight: color.hsv(hue, 1, .75),
  40.             colorLeft: color.hsv(hue, 1, .4),
  41.             size: (i+1)*3,
  42.             h: (i+1)*1.9
  43.         })        
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment