baditchylearnsp5js
baditchylearnsp5js
baditchy learns p5.js
18 posts
Don't wanna be here? Send us removal request.
baditchylearnsp5js 3 years ago
Photo
Tumblr media
cube // tear // chop
https://editor.p5js.org/asarmiento/sketches/bsOLVZrHW
let karo; function preload() { 聽karo = loadFont('KaroPro-Column.otf'); } function setup() { 聽createCanvas(400, 400, WEBGL); 聽textFont(karo); 聽textSize(width / 3); 聽textAlign(CENTER, CENTER); } function draw() { 聽background(123, 3, 252); 聽let time1 = millis(); 聽rotateX(time1 / 1000); 聽rotateZ(time1 / 1234); 聽fill(0); 聽text('cube', 0, 0);
聽let time2 = millis(); 聽rotateX(time2 / 1000); 聽rotateZ(time2 / 1234); 聽fill(161, 255, 164); 聽text('tear', 0, 0);
聽let time3 = millis(); 聽rotateX(time3 / 1000); 聽rotateZ(time3 / 1234); 聽fill(255); 聽text('chop', 0, 0); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
snip
https://editor.p5js.org/asarmiento/sketches/26m_59k6r
let sourceText = "snipsnipsnip"; let curIndex = 0;
function setup() { 聽createCanvas(400, 400); 聽frameRate(1); }
function preload() { 聽font = loadFont("KaroPro-Column.otf"); }
function draw() { 聽background(161, 255, 164); 聽fill(123, 3, 252); 聽textFont(font); 聽textSize(750); 聽textAlign(CENTER, CENTER); 聽text(sourceText.substring(curIndex, curIndex + 1), width / 2, height / 2); 聽curIndex++; 聽if (curIndex > sourceText.length) { 聽 聽curIndex = 0; 聽}
聽noStroke(); 聽fill(0); 聽textSize(250); 聽text("snip", width / 2, height / 2); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
collage
https://editor.p5js.org/asarmiento/sketches/aTO5PeMEZ
let canvasSize = (600, 600); let grSize = canvasSize;
function preload() { 聽font = loadFont("KaroPro-Column.otf"); }
function setup() { 聽createCanvas(canvasSize, canvasSize); 聽frameRate(20); 聽pg = createGraphics(grSize, grSize); }
function draw() {
聽pg.background(161, 255, 164); 聽pg.fill(123, 3, 252); 聽pg.textFont("Helvetica"); 聽pg.textSize(canvasSize/4);
聽pg.push(); 聽pg.translate(grSize/2, grSize/3); 聽pg.textAlign(LEFT, CENTER); 聽pg.textLeading(canvasSize/6.6-10); 聽pg.text("collage merge mix merge", -canvasSize/2.5, -canvasSize/8, 100); 聽 pg.pop();
聽image(pg, 0, 0);
聽let tilesX = 20; 聽let tilesY = 20;
聽let tileW = int(width/tilesX); 聽let tileH = int(height/tilesY);
聽for (let y = 0; y < tilesY; y++) { 聽 聽for (let x = 0; x < tilesX; x++) {
聽 聽//warp 聽 聽let wave = int(sin(frameCount * 0.05 聽+ ( x * y ) * .04) * 50);
聽 聽// source 聽 聽let sx = x*tileW + wave; 聽 聽let sy = y*tileH + wave; 聽 聽let sw = tileW; 聽 聽let sh = tileH;
聽 聽// destination 聽 聽let dx = x*tileW; 聽 聽let dy = y*tileH; 聽 聽let dw = tileW; 聽 聽let dh = tileH;
聽 聽copy(pg, sx, sy, sw, sh, dx, dy, dw, dh);
聽 聽} 聽} }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
cut // distort
https://editor.p5js.org/asarmiento/sketches/4p79GU6jn
let tileSize = 150; 聽// size tiles to make let tiles; 聽 聽 聽 聽 聽// list of tiles, created in setup() let font; 聽 聽 聽 聽 聽 // font we'll use
function preload() { 聽font = loadFont ('KaroPro-Column.otf'); }
function setup() { 聽createCanvas (windowWidth,windowHeight);
聽// draw the text to a graphics object 聽let pg = createGraphics(width, height); 聽pg.background(123, 3, 252); 聽pg.textFont(font); 聽pg.textAlign(CENTER, CENTER); 聽pg.textSize(250); 聽pg.fill(161, 255, 164); 聽pg.noStroke(); 聽pg.text('distort', pg.width/2, pg.height/2);
聽// additonal graphics 聽pg.textSize(25); 聽for (let i=0; i<100; i++) { 聽 聽pg.text('cut', random(pg.width), random(pg.height)); 聽} 聽fill(0);
聽// creating tiles for our graphics 聽tiles = []; 聽for (let y=0; y<pg.height; y+=tileSize) { 聽 聽for (let x=0; x<pg.width; x+=tileSize) { 聽 聽 聽let tile = new Tile(x, y, tileSize, pg); 聽 聽 聽tiles.push(tile); 聽 聽} 聽} 聽print(tiles); }
function draw() { 聽// background(50);
聽//for loop rendering tiles on canvas for (let i=0; i<tiles.length; i++){ 聽 tiles[i].display(); } }
class Tile { 聽constructor(x, y, w, pg) { 聽 聽this.x = x; 聽 聽this.y = y;
聽 聽this.img = createImage(w, w); 聽 聽this.img.copy(pg, x,y, w,w, 0,0, w,w); 聽} 聽display() { 聽 聽push(); 聽 聽translate(this.x, this.y); 聽 聽//rotate(map(mouseX, 0,width, 0,TWO_PI)); 聽 聽//scale(mouseX*.01, mouseY *.01); 聽 聽shearX(mouseY*.01, TWO_PI); 聽 聽shearY(mouseY*.01, TWO_PI); 聽 聽image(this.img, 5, 2.5); 聽 聽pop(); 聽} }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
cut // paste
https://editor.p5js.org/asarmiento/sketches/qCKsY3Y38
let karo; let x, y; let fontSize = 150; let firstLetter = []; let secondLetter = [];
function preload() { 聽karo = loadFont("KaroPro-Column.otf"); }
function setup() { 聽createCanvas(400, 400); 聽textFont(karo); 聽textSize(fontSize);
聽x = width / 5 - 50; 聽y = height / 2 + 50;
聽//text to points functions 聽firstLetter = karo.textToPoints("cut", x, y, fontSize, { 聽 聽sampleFactor: 0.1, 聽});
聽secondLetter = karo.textToPoints("paste", x, y, fontSize, { 聽 聽sampleFactor: 0.05, 聽});
聽print(firstLetter.length, secondLetter.length);
聽noLoop(); }
function draw() { 聽background(123, 3, 252);
聽beginShape(); 聽for (let i = 0; i < firstLetter.length; i++) {
聽push(); 聽fill (161, 255, 164); 聽stroke (161, 255, 164); 聽translate(firstLetter[i].x, firstLetter[i].y); 聽ellipse(10, -10, 8, 4); 聽pop();
聽//conditions 聽if(firstLetter[i].x <= secondLetter[i].x){ 聽 聽firstLetter[i].x++; 聽} 聽if(firstLetter[i].x >= secondLetter[i].x){ 聽firstLetter[i].x--; 聽} 聽if(firstLetter[i].y >= secondLetter[i].y){ 聽firstLetter[i].y--; 聽} 聽if(firstLetter[i].y <= secondLetter[i].y){ 聽firstLetter[i].y++; 聽}
聽} 聽endShape(); }
function mousePressed(){ 聽loop(); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
scatter
https://editor.p5js.org/asarmiento/sketches/7IL4Dqqc0
let karo let fontSize = 150 let scatterArray
function preload() { 聽karo = loadFont('KaroPro-Column.otf') }
function setup() { 聽createCanvas(400, 400); 聽textFont(karo); 聽textSize(fontSize); 聽frameRate(20);
聽scatterArray = karo.textToPoints("scatter", width/2 - 180, height/2 + 50, fontSize, {sampleFactor: 0.1}); 聽
}
function draw() { 聽background(161, 255, 164); 聽text("scatter", width/2 - 180, height/2 + 50);
聽//beginShape(); 聽for (let i = 0; i <scatterArray.length; i++){ 聽 聽push(); 聽 聽fill(123, 3, 252); 聽 聽stroke(123, 3, 252); 聽 聽ellipse(scatterArray[i].x, scatterArray[i].y, 2.5, 4); 聽 聽pop();
}
}
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
Neon Wave
https://editor.p5js.org/asarmiento/sketches/Ngnos3oN9
let tileSize = 50; // size tiles to make let tiles; // list of tiles, created in setup() let font; // font we'll use
function preload() { 聽font = loadFont("assets/manteka.ttf"); }
function setup() { 聽createCanvas(windowWidth, windowHeight);
// draw the text to a graphics object 聽let pg = createGraphics(width, height); 聽pg.background(255, 84, 238); 聽pg.textFont(font); 聽pg.textAlign(CENTER, CENTER); 聽pg.textSize(200); 聽pg.fill(148, 255, 162); 聽pg.stroke(162, 148, 255); 聽pg.strokeWeight(5); 聽pg.text("wave", pg.width / 2, pg.height / 2);
聽// additonal graphics 聽pg.textSize(20); 聽fill(0, 8, 255); 聽for (let i = 0; i < 100; i++) { 聽 聽pg.text("ocean", random(pg.width), random(pg.height)); 聽}
聽// creating tiles for our graphics 聽tiles = []; 聽for (let y = 0; y < pg.height; y += tileSize) { 聽 聽for (let x = 0; x < pg.width; x += tileSize) { 聽 聽 聽let tile = new Tile(x, y, tileSize, pg); 聽 聽 聽tiles.push(tile); 聽 聽} 聽} 聽print(tiles); }
function draw() { 聽// background(50);
聽//for loop rendering tiles on canvas 聽for (let i = 0; i < tiles.length; i++) { 聽 聽tiles[i].display(); 聽} }
class Tile { 聽constructor(x, y, w, pg) { 聽 聽this.x = x; 聽 聽this.y = y;
聽 聽this.img = createImage(w, w); 聽 聽this.img.copy(pg, x, y, w, w, 0, 0, w, w); 聽} 聽display() { 聽 聽push(); 聽 聽translate(this.x, this.y); 聽 聽rotate(map(mouseX, 1, width, 0, PI)); 聽 聽//scale(mouseX*.01, mouseY *.01); 聽 聽shearX(mouseY * 0.05, mouseX * 0.05); 聽 聽image(this.img, 0, 0); 聽 聽pop(); 聽} }
1 note View note
baditchylearnsp5js 3 years ago
Photo
Tumblr media
pointy boys
https://editor.p5js.org/asarmiento/sketches/nJEnVyalw
let grotesk; let x, y; let fontSize = 75; let firstLetter = []; let secondLetter = []; let r = 0.02; let t = 0.1;
function preload() { 聽grotesk = loadFont("Grotesk_Bold.otf"); }
function setup() { 聽createCanvas(400, 400); 聽textFont(grotesk); 聽textSize(fontSize); 聽// rectMode(CENTER);
聽x = width / 2 - 187; 聽y = height / 2 - 50;
聽//text to points functions 聽firstLetter = grotesk.textToPoints("HEDGEHOG", x, y, fontSize, { 聽 聽sampleFactor: 0.11, 聽});
聽secondLetter = grotesk.textToPoints("PORCUPINE", x, y, fontSize, { 聽 聽sampleFactor: 0.112, 聽});
聽fill(61, 35, 13); 聽pointyArray = grotesk.textToPoints("pointy boys", x, y + 200, fontSize, { sampleFactor: 0.1});
聽print(firstLetter.length, secondLetter.length);
聽noLoop(); }
function draw() { 聽background(209, 255, 226); 聽//text('W', width/2 - 80, height/2 + 65);
聽beginShape(); 聽for (let i = 0; i < firstLetter.length; i++){
聽 聽push(); 聽 聽translate(firstLetter[i].x, firstLetter[i].y); 聽 聽stroke(120, 255, 172); 聽 聽rotate(r); 聽 聽r++; 聽 聽line(width, height, 1, 1); 聽 聽pop();
聽 聽push(); 聽 聽translate(firstLetter[i].x, firstLetter[i].y); 聽 聽stroke(56, 168, 99); 聽 聽rotate(r); 聽 聽r++; 聽 聽line(-100, -100, 1, 1); 聽 聽pop();
聽 聽push(); 聽 聽translate(firstLetter[i].x, firstLetter[i].y); 聽 聽stroke(13, 61, 31); 聽 聽rotate(r); 聽 聽r++; 聽 聽line(-50, -50, 1, 1); 聽 聽pop(); 聽}
聽//shape for first letter 聽beginShape(); 聽for (let i = 0; i < firstLetter.length; i++) { 聽 聽//vertex(firstLetter[i].x, firstLetter[i].y); 聽 聽//vertex(secondLetter[i].x, secondLetter[i].y); 聽 聽//ellipse(firstLetter[i].x, firstLetter[i].y, 10, 10);
聽 聽push(); 聽 聽translate(firstLetter[i].x, firstLetter[i].y); 聽 聽stroke(255); 聽 聽fill(255, 194, 161); 聽 聽ellipse(-10, -10, 7, 7); 聽 聽pop();
聽 聽//conditions 聽 聽push(); 聽 聽if (firstLetter[i].x <= secondLetter[i].x) { 聽 聽 聽firstLetter[i].x++; 聽 聽} 聽 聽if (firstLetter[i].x >= secondLetter[i].x) { 聽 聽 聽firstLetter[i].x--; 聽 聽} 聽 聽if (firstLetter[i].y >= secondLetter[i].y) { 聽 聽 聽firstLetter[i].y--; 聽 聽} 聽 聽if (firstLetter[i].y <= secondLetter[i].y) { 聽 聽 聽firstLetter[i].y++; 聽 聽} 聽 聽pop(); 聽}
聽endShape();
聽beginShape();
聽for (let i = 0; i < pointyArray.length; i++) { 聽 聽push(); 聽 聽stroke(191, 159, 132); 聽 聽fill(143, 106, 74); 聽 聽// translate(pointyArray[i].x, pointyArray[i].y); 聽 聽// rotate(t); 聽 聽// t++; 聽 聽ellipse(pointyArray[i].x, pointyArray[i].y, 20, 20); 聽 聽pop();
聽 聽push(); 聽 聽noStroke(); 聽 聽fill(61, 35, 13); 聽 聽text("pointy boys", x, y + 200); 聽 聽pop(); 聽}
聽endShape(CLOSE); }
function mousePressed() { 聽loop(); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
cat dog rat
https://editor.p5js.org/asarmiento/sketches/4EgcL1dxF
let grotesk; let x, y; let fontSize = 150; let firstLetter = []; let secondLetter = [];
var z = -2; var w = 50;
function preload() { 聽grotesk = loadFont("Grotesk_Bold.otf"); }
function setup() { 聽createCanvas(400, 400); 聽textFont(grotesk); 聽textSize(fontSize); 聽// rectMode(CENTER);
聽x = width / 2 - 100; 聽y = height / 2 + 50;
聽//text to points functions 聽firstLetter = grotesk.textToPoints("dog", x, y, fontSize, { 聽 聽sampleFactor: 0.1, 聽});
聽secondLetter = grotesk.textToPoints("cat", x, y, fontSize, { 聽 聽sampleFactor: 0.1375, 聽});
聽print(firstLetter.length, secondLetter.length);
聽noLoop(); }
function draw() { 聽background(209, 255, 226); 聽//text('W', width/2 - 80, height/2 + 65);
聽push(); 聽z += 0.02; 聽translate(width / 2 - 100, height / 2 + 150); 聽rotate(z, 50); 聽fill(196, 199, 177); 聽textSize(50); 聽text("rat", 50, 50); 聽pop();
聽push(); 聽w += 0.02; 聽translate(width / 2 + 100, height / 2 - 100); 聽rotate(w, 50); 聽fill(177, 180, 199); 聽textSize(50); 聽text("mice", 50, 50); 聽pop();
聽//shape for first letter 聽beginShape(); 聽for (let i = 0; i < firstLetter.length; i++) { 聽 聽//vertex(firstLetter[i].x, firstLetter[i].y); 聽 聽//vertex(secondLetter[i].x, secondLetter[i].y); 聽 聽//ellipse(firstLetter[i].x, firstLetter[i].y, 10, 10);
聽 聽push(); 聽 聽translate(firstLetter[i].x, firstLetter[i].y); 聽 聽fill(255, 194, 161); 聽 聽noStroke(); 聽 聽ellipse(-10, -10, 15, 10); 聽 聽pop();
聽 聽//conditions 聽 聽if (firstLetter[i].x <= secondLetter[i].x) { 聽 聽 聽firstLetter[i].x++; 聽 聽} 聽 聽if (firstLetter[i].x >= secondLetter[i].x) { 聽 聽 聽firstLetter[i].x--; 聽 聽} 聽 聽if (firstLetter[i].y >= secondLetter[i].y) { 聽 聽 聽firstLetter[i].y--; 聽 聽} 聽 聽if (firstLetter[i].y <= secondLetter[i].y) { 聽 聽 聽firstLetter[i].y++; 聽 聽} 聽} 聽endShape(); }
function mousePressed() { 聽loop(); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
no/ya
https://editor.p5js.org/asarmiento/sketches/n7SknQPPi
let grotesk; let x, y; let r = 0.02; let fontSize = 300; let firstLetter = []; let secondLetter = []; let thirdLetter = []; let fourthLetter = [];
function preload() { 聽grotesk = loadFont("Grotesk_Bold.otf"); }
function setup() { 聽createCanvas(400, 400); 聽textFont(grotesk); 聽textSize(fontSize);
聽x = width / 2 - 150; 聽y = height / 2 + 65;
聽//text to points functions 聽firstLetter = grotesk.textToPoints("no", x, y, fontSize, { 聽 聽sampleFactor: 0.1, 聽}); 聽secondLetter = grotesk.textToPoints("ya", x, y, fontSize, { 聽 聽sampleFactor: 0.0934});
聽print(firstLetter.length, secondLetter.length);
聽noLoop(); }
function draw() { 聽background(0); 聽//text('z', width/2 - 80, height/2 + 65);
聽//shape for first letter 聽beginShape(); 聽for (let i = 0; i < firstLetter.length; i++) { 聽 聽//vertex(firstLetter[i].x, firstLetter[i].y); 聽 聽//vertex(secondLetter[i].x, secondLetter[i].y); 聽 聽//ellipse(firstLetter[i].x, firstLetter[i].y, 10, 10);
聽 聽push(); 聽 聽translate(firstLetter[i].x, firstLetter[i].y); 聽 聽rotate(r); 聽 聽r++; 聽 聽stroke(255, 229, 158); 聽 聽line(-10, -10, 10, 10); 聽 聽pop();
聽 聽//conditions 聽 聽if (firstLetter[i].x <= secondLetter[i].x) { 聽 聽 聽firstLetter[i].x++; 聽 聽} 聽 聽if (firstLetter[i].x >= secondLetter[i].x) { 聽 聽 聽firstLetter[i].x--; 聽 聽} 聽 聽if (firstLetter[i].y >= secondLetter[i].y) { 聽 聽 聽firstLetter[i].y--; 聽 聽} 聽 聽if (firstLetter[i].y <= secondLetter[i].y) { 聽 聽 聽firstLetter[i].y++; 聽 聽} 聽} 聽endShape(); 聽} function mouseDragged() { 聽loop(); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
Attention
https://editor.p5js.org/asarmiento/sketches/pDCQymm7m
let grotex let fontSize = 50 let thenArray let attenArray let hereArray let r = 0;
function preload() { 聽grotex = loadFont('Grotex Regular.ttf') }
function setup() { 聽createCanvas(400, 400); 聽textFont(grotex); 聽textSize(fontSize); 聽frameRate(20);
聽thenArray = grotex.textToPoints("nOw tHEn", 175, 75, fontSize, {sampleFactor: 0.5});
聽attenArray = grotex.textToPoints("attention", width/3, height/2, fontSize, {sampleFactor: 0.5}); 聽
聽hereArray = grotex.textToPoints("HERE!!! !!", 175, 350, fontSize, {sampleFactor: 0.5});
}
function draw() { 聽background(158, 255, 184);
聽beginShape(); 聽for (let i = 0; i < hereArray.length; i++){
聽 聽stroke(99, 164, 255); 聽 聽fill(255); 聽 聽text("nOw tHEn", 160, 75);
聽 聽stroke(99, 164, 255); 聽 聽fill(255); 聽 聽text("allright", 25, 350);
聽} 聽endShape(CLOSE);
聽beginShape(); 聽for (let i = 0; i < attenArray.length; i++){
聽 聽stroke(182, 99, 255); 聽 聽fill(255, 158, 250); 聽 聽ellipse(attenArray[i].x, attenArray[i].y, 5, 100);
聽 聽//line(attenArray[i].x, attenArray[i].y, 0, 0);
聽 聽//single lines along path with rotation 聽
聽 聽push(); 聽 聽rotate(r); 聽 聽r++; 聽 聽stroke(255, 130, 92); 聽 聽fill(161, 158, 255); 聽 聽text("lOOK", 25, 75); 聽 聽pop();
聽//vertex(attenArray[i].x, attenArray[i].y)
} 聽endShape(CLOSE);
聽beginShape(); 聽for (let i = 0; i < hereArray.length; i++){
聽 聽push(); 聽 聽translate(hereArray[i].x, hereArray[i].y); 聽 聽rotate(r); 聽 聽r++; 聽 聽stroke(255, 242, 158); 聽 聽fill(234, 255, 158); 聽 聽ellipse(-10, -10, 20, 10); 聽 聽pop();
聽 noStroke(); 聽 聽fill(255, 158, 181); 聽 聽text("HERE!!! !!", 175, 350);
聽} 聽endShape(CLOSE); 聽 }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
Space
https://editor.p5js.org/asarmiento/sketches/FT9zpQRCS
let victor; let fontSize = 75; let welArray; let r = 0.01; let z = 0.02;
function preload() { 聽victor = loadFont("VictorMono-Bold.otf"); }
function setup() { 聽createCanvas(600, 600); 聽textFont(victor); 聽textSize(fontSize); 聽frameRate(50);
聽asteroidArray = victor.textToPoints("aster", 200, 550, fontSize, { 聽 聽sampleFactor: 0.1, 聽});
聽dustArray = victor.textToPoints("space dust", 75, 100, fontSize, { 聽 聽sampleFactor: 0.1, 聽}); }
function draw() { 聽background(0);
聽beginShape();
聽for (let i = 0; i < dustArray.length; i++) { 聽 聽push(); 聽 聽stroke(36, 36, 36); 聽 聽fill(15, 15, 15); 聽 聽ellipse(dustArray[i].x, dustArray[i].y, 10, 10); 聽 聽pop();
聽 聽push(); 聽 聽noStroke(); 聽 聽fill(20, 20, 20); 聽 聽text("space dust", 75, 100); 聽 聽pop(); 聽}
聽endShape(CLOSE);
聽for (let i = 0; i < asteroidArray.length; i++) { 聽 聽push(); 聽 聽stroke(255, 130, 92); 聽 聽fill(255, 228, 92); 聽 聽text("sun", 150, 250); 聽 聽textSize(100); 聽 聽pop();
聽 聽push(); 聽 聽stroke(42, 48, 79); 聽 聽fill(171, 219, 255); 聽 聽text("moon", 450, 550); 聽 聽pop();
聽 聽for (let i = 0; i < asteroidArray.length; i++) { 聽 聽 聽push(); 聽 聽 聽rotate(r); 聽 聽 聽r++; 聽 聽 聽ellipse(asteroidArray[i].x, asteroidArray[i].y, 5, 4); 聽 聽 聽fill(0); 聽 聽 聽pop(); 聽 聽} 聽}
聽endShape(CLOSE); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
Welcome Home
https://editor.p5js.org/asarmiento/sketches/8X5N0fg1a
let grotex; let fontSize = 75; let welArray; let r = 0.01; let z = 0.02;
function preload() { 聽victor = loadFont("VictorMono-Bold.otf"); }
function setup() { 聽createCanvas(600, 600); 聽textFont(victor); 聽textSize(fontSize); 聽frameRate(20);
聽welArray = victor.textToPoints("welcome", width / 4, height / 5, fontSize, { 聽 聽sampleFactor: 0.1, 聽});
聽homeArray = victor.textToPoints("home", width / 4, height / 5, fontSize, { 聽 聽sampleFactor: 0.1, 聽}); }
function draw() { 聽background(255, 199, 187);
聽text("home", width / 2, 500);
聽beginShape(); 聽for (let i = 0; i < welArray.length; i++) { 聽 聽push(); 聽 聽rotate(z); 聽 聽fill(255, 248, 179); 聽 聽noStroke(); 聽 聽z++; 聽 聽ellipse(welArray[i].x, welArray[i].y, 25, 10); 聽 聽pop();
聽 聽//single lines along path with rotation 聽 聽push(); 聽 聽translate(welArray[i].x, welArray[i].y); 聽 聽rotate(r); 聽 聽r++; 聽 聽line(-10, -10, 10, 1); 聽 聽pop();
聽 聽vertex(welArray[i].x, welArray[i].y); 聽 聽fill(255, 187, 254);
聽 聽line(welArray[i].x, welArray[i].y, 50, 500); 聽 聽stroke(255); 聽}
聽endShape(CLOSE); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
go for a walk
https://editor.p5js.org/asarmiento/sketches/funmdf9m2
function setup() { 聽createCanvas(500, 500); 聽noLoop(); }
function draw() { 聽background(181, 229, 255);
聽//do you want to
聽fill(181, 255, 192); 聽stroke(0); 聽textFont("Helvetica"); 聽textSize(height / 7); 聽text("do you want to", width / 4500, height / 2);
聽//on the beach
聽textFont("Arial"); 聽textSize(50); 聽fill(209, 181, 255); 聽stroke(96, 0, 255); 聽text("on the beach", 200, 475); 聽textAlign(RIGHT, BOTTOM);
聽//go for a walk
聽textFont("Helvetica"); 聽textSize(25); 聽textAlign(RIGHT, BOTTOM); 聽let numSteps = width / 5; 聽for (let i = 0; i < numSteps; i++) { 聽 聽let c1 = color(181, 255, 202); 聽 聽let c2 = color(255, 193, 181); 聽 聽fill(lerpColor(c1, c2, 1 / numSteps));
聽 聽let x = map(i, 0, numSteps, width, 0); 聽 聽let y = map(i, 0, numSteps, height, 0); 聽 聽let a = map(i, 0, numSteps, 0, 400);
聽 聽push(); 聽 聽translate(x, y); 聽 聽rotate(a); 聽 聽text("go for a walk", 0, 0); 聽 聽pop(); 聽} }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
Here I am
https://editor.p5js.org/asarmiento/sketches/eXgmZlKl5
function preload() { 聽gulax = loadFont("Gulax-Regular.otf"); }
function setup() { 聽createCanvas(500, 500); }
function draw() { 聽background(209, 181, 255);
聽//there i was 聽push(); 聽fill(229, 204, 255); 聽textFont("Helvetica"); 聽textSize(200); 聽rotate(135, 6); 聽text("there", 5, -250); 聽text("i was", 5, -75); 聽pop();
聽//here i am 聽textFont("Helvetica"); 聽textSize(30); 聽textAlign(RIGHT, BOTTOM); 聽let numSteps = width / 5;
聽for (let i = 0; i < numSteps; i++) { 聽 聽let c1 = color(189, 255, 245); 聽 聽let c2 = color(130, 136, 255); 聽 聽fill(lerpColor(c1, c2, i / numSteps));
聽 聽let x = map(i, 0, numSteps, width, 0); 聽 聽let y = map(i, 0, numSteps, height, 0); 聽 聽let a = map(i, 0, numSteps, 30, TWO_PI);
聽 聽push(); 聽 聽translate(x, y); 聽 聽rotate(a); 聽 聽text("here i am", 0, 0); 聽 聽pop(); 聽} }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
Loading
https://editor.p5js.org/asarmiento/sketches/1OPaJf_-Z
function preload() { 聽flower = loadFont("HealTheWebB-Regular.otf"); }
function setup() { 聽createCanvas(500, 500); 聽noLoop(); }
function draw() { 聽background(0);
聽//first piece of text 聽fill(255, 255, 255); 聽text("loading", 75, 75);
聽// second piece of text 聽textFont(flower); 聽noStroke(); 聽fill(255, 166, 245); 聽textSize(72); 聽text("loading", 50, 150); 聽textAlign(CENTER, CENTER);
聽// third piece of text 聽fill(0, 255, 125); 聽textFont("Brush Script MT"); 聽textSize(height / 3); 聽text("loading", width / 2, height / 2); }
0 notes
baditchylearnsp5js 3 years ago
Photo
Tumblr media
3d spin
https://editor.p5js.org/asarmiento/sketches/ljpzeyVMT
function setup() { 聽createCanvas(500, 500, WEBGL); }
function draw() { 聽//sphere 聽background(20); 聽rotateX(frameCount * 0.01); 聽rotateZ(frameCount * 0.01); 聽sphere(30); 聽fill(255, 179, 186); 聽pop();
聽//cylinder 聽translate(50, 75); 聽rotateX(frameCount * 0.01); 聽rotateZ(frameCount * 0.01); 聽cylinder(20, 50); 聽fill(255, 223, 186); 聽pop();
聽//cone 聽translate(75, 100); 聽rotateX(frameCount * 0.01); 聽rotateZ(frameCount * 0.01); 聽cone(30, 60); 聽fill(255, 255, 186); 聽pop();
聽//ellipsoid 聽translate(50, 50); 聽scale(2); 聽rotateY(millis() / 1000); 聽ellipsoid(15, 15, 10); 聽fill(186, 255, 201); 聽pop();
聽//torus donut 聽translate(30, 30); 聽rotateX(frameCount * 0.01); 聽rotateY(frameCount * 0.01); 聽torus(10, 5); 聽fill(186, 225, 255); 聽scale(2); 聽pop(); }
0 notes