Advertisement
xeromino

bal

Dec 7th, 2015
248
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(2);
  6.     glc.setFPS(30);
  7.     glc.setMode("single");
  8.     // glc.setEasing(false);
  9.    
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color,
  14.         ox = width/2,
  15.         oy = height/2,
  16.         TWO_PI = Math.PI*2;
  17.  
  18.     // your code goes here:
  19.    
  20.     var d = 250,
  21.         num = 40;
  22.    
  23.     for (var i=0; i<num; i++) {
  24.         list.addBezierCurve({
  25.                 x0: function(t){
  26.                     return 150 + Math.cos(Math.PI+t*TWO_PI)*d/2;
  27.                 },
  28.                 y0: function(t) {
  29.                     return 150 + Math.sin(Math.PI+t*TWO_PI)*d/2;
  30.                 },
  31.                 x1: 350+2*i,
  32.                 y1: 300+3*i,
  33.                 x2: 56,
  34.                 y2: 275,
  35.                 x3: function(t){
  36.                     return ox + Math.cos(t*TWO_PI)*d;
  37.                 },
  38.                 y3: function(t) {
  39.                     return oy + Math.sin(t*TWO_PI)*d;
  40.                 },
  41.             lineWidth: 8
  42.            
  43.         });
  44.     }
  45.  
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement