From ecd0485e95ef82a27248bb1b6fadfa851b378bdf Mon Sep 17 00:00:00 2001 From: bbaudry Date: Thu, 30 Jan 2025 16:56:07 -0500 Subject: [PATCH] *[]}><{[]* --- ift6251/p5/cours2.html | 23 ++++++ ift6251/p5/cours2.js | 37 ++++++++++ ift6251/p5/cours3.html | 23 ++++++ ift6251/p5/cours3.js | 146 +++++++++++++++++++++++++++++++++++++ p5-experiments/plein003.js | 27 ++++--- 5 files changed, 244 insertions(+), 12 deletions(-) create mode 100644 ift6251/p5/cours2.html create mode 100644 ift6251/p5/cours2.js create mode 100644 ift6251/p5/cours3.html create mode 100644 ift6251/p5/cours3.js diff --git a/ift6251/p5/cours2.html b/ift6251/p5/cours2.html new file mode 100644 index 00000000..e888c9b1 --- /dev/null +++ b/ift6251/p5/cours2.html @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ift6251/p5/cours2.js b/ift6251/p5/cours2.js new file mode 100644 index 00000000..d7286170 --- /dev/null +++ b/ift6251/p5/cours2.js @@ -0,0 +1,37 @@ +var w, h, cnv + +function setup() { + w = 800 + h = 800 + cnv = createCanvas(w, h); + var x = (windowWidth - w) / 2; + var y = (windowHeight - h) / 2; + cnv.position(x, y); + colorMode(HSB, 360, 100, 100, 250); + // noLoop() +} + +function draw() { + background(0, 0, 0) + stroke(0, 0, 100) + noFill() + rect(0, 0, w, h) + stroke(0, 0, 0) + fill(50, 100, 100) + var size = w * 0.9 + // rect(w*0.5-size*0.5,h*0.5-size*0.5,size,size) + var vera = 21 + var molnar = 11 + var hsize = size * 0.5 + var udem=false + for (i = 0; i < molnar; i++) { + if(udem){fill(50, 0, 0, 120);udem=false} + else{fill(50, 100, 100, 120);udem=true} + quad(w * 0.5 - hsize + random(-vera, vera), h * 0.5 - hsize + random(-vera, vera), + w * 0.5 + hsize + random(-vera, vera), h * 0.5 - hsize + random(-vera, vera), + w * 0.5 + hsize + random(-vera, vera), h * 0.5 + hsize + random(-vera, vera), + w * 0.5 - hsize + random(-vera, vera), h * 0.5 + hsize + random(-vera, vera)) + hsize -= size * 0.05 + } +} + diff --git a/ift6251/p5/cours3.html b/ift6251/p5/cours3.html new file mode 100644 index 00000000..e5b546b8 --- /dev/null +++ b/ift6251/p5/cours3.html @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ift6251/p5/cours3.js b/ift6251/p5/cours3.js new file mode 100644 index 00000000..79f0e93f --- /dev/null +++ b/ift6251/p5/cours3.js @@ -0,0 +1,146 @@ +function preload() { + font = loadFont("./FreeMono.otf"); +} +var w, h, cnv, stepsize, nbhorizontalsteps, nbvertcicalsteps, grid, font + +function setup() { + w = 800 + h = 800 + cnv = createCanvas(w, h); + var x = (windowWidth - w) / 2; + var y = (windowHeight - h) / 2; + cnv.position(x, y); + colorMode(HSB, 360, 100, 100, 250); + stepsize = Math.floor(w * 0.02) + nbhorizontalsteps = Math.floor(w / stepsize) + nbvertcicalsteps = Math.floor(h / stepsize) + // noLoop() +} + +function draw() { + background(0, 0, 100) + stroke(0, 0, 0) + //initgrid1() + //asciigrid() + grid() + noLoop() +} +function grid(){ + var res = 50 + noStroke() + for(var i=0;i