Skip to content

Commit

Permalink
.*}°><°{*.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaudry committed Nov 3, 2023
1 parent 84aa3cb commit bef230e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 30 deletions.
6 changes: 3 additions & 3 deletions p5-experiments/flowfield002.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@
}

function draw() {
drawfieldangles()
//drawfieldangles()
zoff+=0.1
//drawcurveinfield(Math.floor(0.5*nbrows), Math.floor(0.9*nbcols), 1, 42)
drawcurveinfield(Math.floor(random()*nbrows), Math.floor(random()*nbcols), 3, 42)
//noLoop()
if(frameCount==300){noLoop()}
if(frameCount==7000){noLoop()}
}

function drawcurveinfield(row, col, offset, len) {
strokeWeight(1.5)
stroke(0,0,0)
stroke(0,0,0,42)
noFill()
beginShape()
x1 = col * res
Expand Down
95 changes: 68 additions & 27 deletions p5-experiments/frenchco-004.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,75 @@
margin: 0;
}
</style>
<style type ="text/css" >
.credits{
position: absolute;
text-align: left;
bottom: 8px;
width: 100%;
color:#000000;
font-family:monospace;
margin-left: 12px;
font-size:14px
}
</style>

<style type="text/css">
.credits {
position: absolute;
text-align: left;
bottom: 8px;
width: 100%;
color: #000000;
font-family: monospace;
margin-left: 12px;
font-size: 21px
}

code {
font-family: monospace;
color: rgb(0, 0, 0);
padding: 2px;
font-size: 105%;
}
</style>

</head>

<body>
<div class="credits">credits:<br>@al.my.re; p5.js; perlin; vera</div>
<div class="credits">

<code>
<pre>


function draw() {
drawrandom()
}

var noisestep = 0.05
function drawrandom() {
let x = Math.floor(noise(xoff) * stepx) * step
xoff += noisestep
let y = Math.floor(noise(yoff) * stepy) * step
yoff += noisestep
stroke(0, 0, 0); noFill()
if (random() < 0.05) {
noStroke(); fill(0, 100, 100)
}
block(x, y, step, step)
}

function block(x, y, step, step){
let size = random()*step
let m = step-size
x+=m/2
y+=m/2
rect(x,y,size,size)
}




</pre>
</code>
credits:<br>@al.my.re; p5.js; perlin; vera
</div>

<script>
//global vars for the whole piece
var w// = 900
var h// = 900
var cnv
var x, y
var xoff,yoff
var xoff, yoff
var step, stepx, stepy

function setup() {
Expand All @@ -54,7 +98,7 @@
step = w / 11
stepx = w / step
stepy = h / step
for(let i=0;i<1111;i++){
for (let i = 0; i < 1111; i++) {
drawrandom()
}
frameRate(2)
Expand All @@ -68,8 +112,6 @@

function draw() {
drawrandom()
save("frenchco004.png")
noLoop()
}

var noisestep = 0.05
Expand All @@ -78,19 +120,18 @@
xoff += noisestep
let y = Math.floor(noise(yoff) * stepy) * step
yoff += noisestep
stroke(0, 0, 0); noFill()
//noStroke(); fill(0, 0, 0)
stroke(0, 0, 0); noFill()
//noStroke(); fill(0, 0, 0)
if (random() < 0.05) { noStroke(); fill(0, 100, 100) }
block(x, y, step, step)
}

function block(x, y, step, step){
let size = random()*step
let m = step-size
x+=m/2
y+=m/2
rect(x,y,size,size)

function block(x, y, step, step) {
let size = random() * step
let m = step - size
x += m / 2
y += m / 2
rect(x, y, size, size)
}

</script>
Expand Down

0 comments on commit bef230e

Please sign in to comment.