Inspiré par Computer Graphics and Art vol3 n°2 page 31, « Unimaginable Images » (from the « 196 Trapeziums Series ») de Vera Molnar
// This sketch is part of the ReCode Project - http://recodeproject.com // From Computer Graphics and Art vol3 no2 pg 31 // Untitled (from the "196 Trapeziums Series") // by Vera Molnar // // // Quin Kennedy // 2012 // Creative Commons license CC BY-SA 3.0 var numTiles = 14; var gutterRelativeSize = 0; var windowSize = 800; function setup(){ var tileSize = floor(windowSize/(numTiles*(1+gutterRelativeSize)+gutterRelativeSize)); var gutterSize = floor(tileSize*gutterRelativeSize); var actualWinSize = (tileSize+gutterSize)*numTiles+gutterSize; createCanvas(actualWinSize, actualWinSize); noLoop(); } function draw(){ background(255); stroke(0); //strokeWeight(2); strokeJoin(ROUND); noFill(); var tileSize = floor(windowSize/(numTiles*(1+gutterRelativeSize)+gutterRelativeSize)); var gutterSize = floor(tileSize*gutterRelativeSize); //for each grid cell... for(var i = 0, gi = gutterSize; i < numTiles; i++, gi += gutterSize+tileSize){ for(var j = 0, gj = gutterSize; j < numTiles; j++, gj += gutterSize+tileSize){ drawTrapezium(random(tileSize, width-tileSize-tileSize), random(tileSize/2., height-tileSize)); } } } function drawTrapezium(xCenter, yCenter){ var tileSize = floor(windowSize/(numTiles*(1+gutterRelativeSize)+gutterRelativeSize)); var topScale = random(-2, 2); var bottomScale = random(-2, 2); var halfTile = tileSize/2.; quad(xCenter - tileSize/2 + random(-tileSize, tileSize), yCenter - halfTile, xCenter + tileSize/2 + random(-tileSize, tileSize), yCenter - halfTile, xCenter + tileSize/2 + random(-tileSize, tileSize), yCenter + halfTile, xCenter - tileSize/2 + random(-tileSize, tileSize), yCenter + halfTile); }