THE RECODE PROJECT / An active archive of computer art
Structure
Zdenek Sykora
source: Computer Graphics and Art
source document: v1n2
date: 1976
http://recodeproject.com/artwork/v1n2structure
All works created for the ReCode Project are covered under the OSI/MIT license.
Le code a été recodé pour Processing par Mitchell Whitelaw.
Le code recodé a été recodé pour P5.JS par jcg
var moduledim = 40; var gridwidth = 11; var gridheight = 22; function setup(){ createCanvas(440,880); smooth(); noLoop(); ellipseMode(CENTER); } function draw(){ push(); noStroke(); translate(moduledim/2,moduledim/2); for (var i=0; i< gridwidth; i++){ for (var j=0; j< gridheight; j++){ var p = int(random(2)); var c = int(random(3)); var o = int(random(4)); sykoraModule(p,c,o,i,j); } } pop(); } function sykoraModule(polarity, composition, orientation, gridx, gridy) { push(); translate(gridx*moduledim,gridy*moduledim); rotate(orientation*TWO_PI/4.0); translate(-moduledim/2, -moduledim/2); fill(polarity*255); // bg fill rect(0,0, moduledim, moduledim); fill(abs(polarity-1)*255); // reverse the fill arc(moduledim/2, 0, moduledim, moduledim, 0, PI); // composition == 0; if (composition == 1){ arc(moduledim/2, moduledim/2, moduledim, moduledim, 0, PI); } else if (composition == 2){ arc(moduledim/2, moduledim, moduledim, moduledim, PI, TWO_PI); } pop(); } function mousePressed(){ save("sykora.png"); redraw(); }
À vous de recoder ce projet pour en faire autre chose ! Changer les couleurs, changer les formes…