eriknau

25Days-21

Dec 21st, 2015
133
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(3);
  5. //     glc.setFPS(20);
  6. //     glc.setMode('single');
  7. //     glc.setEasing(false);
  8.     var list = glc.renderList,
  9.         width = glc.w,
  10.         height = glc.h,
  11.         color = glc.color;
  12.     var headY = 50, headX = width/2+30;
  13.         list.addCircle({
  14.             x:headX,
  15.             y:headY,
  16.             radius:30,
  17.             fill: true
  18.         })
  19.         list.addLine({
  20.             x0:headX-5,
  21.             y0:headY+30,
  22.             x1:headX-30,
  23.             y1:headY+130,
  24.             lineWidth:15
  25.         })
  26.         //upper body
  27.         var rotStart = [-40,90],
  28.             rotEnd = [90,-40];
  29.         for(var i = 0; i<2; i++){
  30.             var joint = list.addContainer({
  31.                 x: headX,
  32.                 y: headY+30,
  33.                 rotation: [rotStart[i],rotEnd[i]]
  34.             })
  35.  
  36.             list.addLine({
  37.                 parent: joint,
  38.                 x0: 0,
  39.                 y0: 0,
  40.                 x1: 0,
  41.                 y1: 100,
  42.                 lineWidth: 3,
  43.             })        
  44.             list.addLine({
  45.                 parent: joint,
  46.                 x0: 0,
  47.                 y0: 100,
  48.                 x1: 80,
  49.                 y1: 50,
  50.                 lineWidth: 3,
  51.             })
  52.             list.addCircle({
  53.                 parent: joint,
  54.                 x: 80,
  55.                 y: 50,
  56.                 radius: 10
  57.             })
  58.         }
  59.     //lower body
  60.         var legRotStart = [-90,40],
  61.             legRotEnd = [40,-90];
  62.         for(var j = 0; j<2; j++){
  63.             var joint = list.addContainer({
  64.                 x: headX-30,
  65.                 y: headY+130,
  66.                 rotation: [legRotStart[j],legRotEnd[j]]
  67.             })
  68.  
  69.             list.addLine({
  70.                 parent: joint,
  71.                 x0: 0,
  72.                 y0: 0,
  73.                 x1: 0,
  74.                 y1: 100,
  75.                 lineWidth: 3,
  76.             })        
  77.             list.addLine({
  78.                 parent: joint,
  79.                 x0: 0,
  80.                 y0: 100,
  81.                 x1: -80,
  82.                 y1: 150,
  83.                 lineWidth: 3,
  84.             })
  85.             list.addCircle({
  86.                 parent: joint,
  87.                 x: -80,
  88.                 y: 150,
  89.                 radius: 10
  90.             })
  91.         }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment