Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- // glc.playOnce();
- glc.size(540, 540);
- glc.setDuration(2);
- glc.setFPS(30);
- glc.setMode("single");
- glc.styles.backgroundColor = "black";
- // glc.setEasing(false);
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- // your code goes here:
- var num = 10, d = 200;
- var TWO_PI = Math.PI*2;
- for (var i=0; i<num; i++) {
- var px = width/2 + Math.cos(-Math.PI/2+TWO_PI/num*i)*d,
- py = height/2 + Math.sin(-Math.PI/2+TWO_PI/num*i)*d,
- dx = width/2 + Math.cos(-Math.PI/2+TWO_PI/num*((i+1)%num))*d,
- dy = height/2 + Math.sin(-Math.PI/2+TWO_PI/num*((i+1)%num))*d,
- s1 = 3+i,
- s2 = 4+i,
- col1 = 360.0/num*i,
- col2 = 360.0/num*(i+1);
- if (i>=num/2) {
- s1 = 3+num-i;
- s2 = s1-1;
- }
- list.addPoly({
- x: [px,dx],
- y: [py,dy],
- radius: 50,
- fillStyle: color.animHSV(col1,col2,.9,.9,.9,.9),
- stroke: true,
- strokeStyle: "white",
- lineWidth:2,
- sides: [s1,s2]
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement