Code Sketch
moving grid
By: Aditya Pant
Category: Art
1


0




size(600, 600) originBottomLeft cleari() val tilecount= 100 val tileheight = cheight/tilecount val tilewidth = cwidth/tilecount def Shape = Picture.rectangle(tilewidth*2, tileheight*2) def block(posx:Double, posy:Double){ val pic =Shape pic.setPosition(posx, posy) pic.setPenColor(cm.lavenderBlush) val d = mathx.distance(posx, posy, mouseX, mouseY) val f = mathx.map(d, 0, 500, 0.3, .9) pic.scale(f) draw(pic) } drawLoop { erasePictures repeatFor(rangeTill(0, cwidth, tilewidth)) { posx => repeatFor(rangeTill(0, cheight, tileheight)) { posy => block(posx, posy) } } }





Your Comment:





Login to post a comment