Skip to content

Commit

Permalink
]*°+><+°*[
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaudry committed Dec 26, 2023
1 parent babe17a commit 3b24b3e
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions p5-experiments/ikeda002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<html>

<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.dom.min.js"></script>
<script src="https://unpkg.com/[email protected]"></script>
<style>
body {
padding: 0;
margin: 0;
}
</style>
</head>

<body>
<script>

var w, h, cnv, xoff, inc

function setup() {
w = windowWidth
h = windowHeight
cnv = createCanvas(w, h);
xoff = 0.0
inc = 1
colorMode(HSB, 360, 100, 100, 250);
noStroke()
background(0,0,0)
sety()
frameRate(42)
}

var ycoords
function sety(){
ycoords=[]
var y1,y2,ystep
ystep=0.2*h
y1=0
while(y1<h){
y2=y1+noise(xoff)*ystep; xoff+=inc
ycoords.push({y1:y1,y2:y2});console.log(y1+" "+y2)
y1=y2
}
}

function draw() {
//background(0,0,0)
var x1, xstep
xstep = 0.1*w
for(var i=0;i<ycoords.length;i++){
x1 = w/2
while(x1<w){
x2=x1+noise(xoff)*xstep; xoff+=inc
if(random()<0.84){fill(0,0,100)}
else{fill(0,0,0)}
if(random()<0.02){fill(220,100,100)}
quad(x1,ycoords[i].y1,x2,ycoords[i].y1,x2,ycoords[i].y2,x1,ycoords[i].y2)
x1=x2
}
x1=w/2
while(x1>0){
x2=x1-noise(xoff)*xstep; xoff+=inc
if(random()<0.84){fill(0,0,100)}
else{fill(0,0,0)}
if(random()<0.02){fill(220,100,100)}
quad(x1,ycoords[i].y1,x2,ycoords[i].y1,x2,ycoords[i].y2,x1,ycoords[i].y2)
x1=x2
}
stroke(0,100,100);line(w/2,0,w/2,h);noStroke()
}
//if(frameCount==1){noLoop();save("ikeda001.png")}
}


function windowResized() {
w = document.documentElement.clientWidth;//width of window that is available for drawing
h = document.documentElement.clientHeight;//width of window that is available for drawing
resizeCanvas(w, h);
}


</script>
</body>

0 comments on commit 3b24b3e

Please sign in to comment.