eriknau

tilt wheels

Dec 8th, 2015
96
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, 280);
  4.     glc.setDuration(4);
  5.     glc.setFPS(20);
  6.     // glc.setMode("single");
  7.     // glc.setEasing(false);
  8.     glc.setMaxColors(100);
  9.     glc.styles.backgroundColor= "orange";
  10.  
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h,
  14.         color = glc.color;
  15.  
  16.     var sticks = function(rot1,rot2,r1,g1,b1,r2,g2,b2) {
  17.         var counter = 0;
  18.         for (var i = 5; i >= 0; i--) {
  19.             for (var j = 8; j >= 0; j--) {
  20.                 var container = list.addContainer({
  21.                     x: (j+1)*40,
  22.                     y: (i+1)*40,
  23.                     rotation: [rot1,rot2],
  24.                     phase: counter*0.006
  25.                 })
  26.  
  27.                 list.addLine({
  28.                     x0: 0,
  29.                     y0: 20,
  30.                     x1: 0,
  31.                     y1: -20,
  32.                     stroke:true,
  33.                     strokeStyle: [color.rgb(r1,g1,b1),color.rgb(r2,g2,b2)],
  34.                     parent: container
  35.                 })
  36.                 counter++;
  37.             }
  38.         }
  39.     }
  40.     for (var i = 0; i < 3; i++) {
  41.         sticks(i*90,(i+1)*180,(i+1)*30,(i+1)*60,(i+1)*90,(i+1)*60,(i+1)*90,(i+1)*120);
  42.     };      
  43. }
Advertisement
Add Comment
Please, Sign In to add comment