Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- glc.size(540, 540);
- glc.setDuration(2.5);
- glc.setFPS(25);
- glc.styles.backgroundColor = "#202020";
- //glc.setMode('single');
- // glc.setEasing(false);
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- // your code goes here:
- var cols = 13,
- rows = cols,
- step = width/cols;
- for (var x=-3*step; x<width+3*step; x += step) {
- for (var y=-3*step; y<height+3*step; y+= step) {
- var dx1 = x,
- dy1 = y,
- dx2 = width/2,
- dy2 = height/2,
- dx3 = dx2-dx1,
- dy3 = dy2-dy1,
- dist1 = Math.sqrt(dx3*dx3 + dy3 * dy3),
- a = 30/dist1;
- list.addCube({
- x: x,
- y:y,
- //y: [y,y-step],
- strokeStyle: color.rgba(255,255,255,a),
- size: step*.5,
- rotationX: [0,90],
- rotationY: [0,90],
- rotationZ: [0,90],
- phase: dist1*-0.001,
- });
- }
- }
- list.addText({
- x: width-50,
- y: height-15,
- text: "p5art.tumblr.com",
- fontSize: 10,
- fillStyle: color.rgba(255,255,255,.5),
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement