Advertisement
xeromino

rotatingThingie

Jan 29th, 2016
418
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(540, 540);
  4.      glc.setDuration(2.5);
  5.      glc.setFPS(30);
  6.     glc.styles.backgroundColor = "#202020";
  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.  
  14.     // your code goes here:
  15.    
  16.     var w = 10,
  17.         c = 0;
  18.         step = 10;
  19.    
  20.     while( w<400) {
  21.         c++;
  22.         list.addRect({
  23.             x: width / 2,
  24.             y: height / 2,
  25.             w: [5,w],
  26.             h: [w,5],
  27.             fill: false,
  28.             stroke: true,
  29.             strokeStyle: color.rgba(255,255,255,.5),
  30.             lineWidth:1,
  31.             rotation: [0+c*3,90+c*2],
  32.             //rotation: [0,180],
  33.             phase: c/150
  34.             //phase: .5/c,
  35.             //phase: Math.sin(w*0.001)
  36.         });
  37.         w += step;
  38.     }
  39.    
  40.     list.addText({
  41.         x: width-50,
  42.         y: height-15,
  43.         text: "p5art.tumblr.com",
  44.         fontSize: 10,
  45.         fillStyle: color.rgba(255,255,255,.5),
  46.        
  47.     });
  48.    
  49.  
  50.  
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement