Advertisement
xeromino

cubes

Feb 5th, 2016
305
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     glc.size(540, 540);
  4.     glc.setDuration(2);
  5.     glc.setFPS(30);
  6.     glc.styles.backgroundColor = "black";
  7. //     glc.setMode('single');
  8. //     glc.setEasing(false);
  9.     var list = glc.renderList,
  10.         width = glc.w,
  11.         height = glc.h,
  12.         color = glc.color,
  13.         TWO_PI = Math.PI*2;
  14.  
  15.     // your code goes here:
  16.    
  17.  
  18.     var cols = 15,
  19.         rows = cols,
  20.         step = width/cols;
  21.    
  22.     for (var x = step/2*3; x<width-step; x+= step) {
  23.         for (var y = step/2*3; y<height-step; y+= step) {
  24.             list.addCube({
  25.                 x: x,
  26.                 y: y,
  27.                 size: [5, step/2],
  28.                 strokeStyle: "white",
  29.                 lineWidth: 1,
  30.                 rotationX: 45,
  31.                 rotationY: [-45,85],
  32.                 rotationZ: 45,
  33.                 phase: Math.pow(1 / (x / width + 0.9), 1 / (y / height + 0.1))
  34.             });  
  35.         }
  36.        
  37.     }
  38.    
  39. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement