Alexandra
Aus exmediawiki
experiments with p5
experiments with p5 and riso
p5 code
generating lines
let v = 0; function setup() {
createCanvas(400, 400); background(220); frameRate (15);
}
function draw() {
v+=4; noFill(); stroke(0,0,0,v) strokeWeight(1); line (0,v,width,v)
} function keyPressed() {
if (key == 's') { save('lines.png'); }
}
Diagonal Colour Changing Spiral let r = 0; let d = 100; let b = 0; let w = 0; let t = 0;
function setup() {
pixelDensity(1); createCanvas(2480, 3508); //din a4 angleMode(DEGREES); rectMode(CENTER); frameRate(15);
}
function draw() {
background(93, 145, 145, 0);
r += 2 ; d += 0.1; b += 4; w = random(1,20); t = random(120,200);
push(); translate(width/3-b , height/4+b); rotate(4 + r); //fill(220, 130, 240,1); noFill(); strokeWeight(1); stroke(t, w, r, d); rect(0, 0, 100, 100); pop();
} function keyPressed() {
save("brush.svg"); print("saved");
}
Magic Pencils attempt let x = 5; let y = 5; let h = 200; let r = 255; let g = 200; let b = 0; let w=100; //let k = 255; //let q = 0; function setup() {
createCanvas(200,600); //createCanvas(3508, 4961); background(255);
}
function draw() {
//background(220); y = y+1; r = random (0,255); b = b + 0.2; g = random (20,200); w = w-0.15; x = x+1; //w = w+1; //h=h-1; //background(r,g,b) stroke (r,g,b,w) strokeWeight (3); //stroke(0); point(5,x); stroke (r,b,g, w); point(10,x); stroke(b,g,r, w); point (15,x); stroke(b,r,r, w); point (20,x); stroke (g,b,g, w); point(25,x); stroke(b,r,r, w); point (30,x); stroke(r,g,b, w); point (35,x); stroke(b,g,r, w); point (45,x); stroke(b,b,r, w); point (40,x); stroke (g,b,g, w); point(55,x); stroke(b,r,r, w); point (50,x); stroke(r,g,b, w); point (65,x); //line (y,0,y,height); //stroke (r, g, b, 100) //line (0,y,width,y);
} function mousePressed() {
save ('dots.svg'); print("saved")
}
back to Material & Prozess 22-23