Skip to content

Commit

Permalink
.}}.><.{{.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaudry committed Oct 27, 2024
1 parent 5474157 commit 5d68f27
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p5-experiments/plottable/phoenix002.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var fSize = 17
var bowie
var xoff = 0.0
var xinc = 0.01
var steps = 10
var steps = 17
var xstep = actualwidth / steps
var ystep = actualheight / steps

Expand All @@ -27,7 +27,7 @@ function draw() {
initgrid()
//showgrid()
xinc = 0.5
for(var i=0;i<42;i++){
for(var i=0;i<84;i++){
cactus()
}
noLoop()
Expand Down
25 changes: 25 additions & 0 deletions p5-experiments/plottable/phoenix003.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!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;
background-color: black;
}
</style>
</head>

<body>
<script src="plottableframe.js"></script>
<script src="phoenix003.js"></script>
<script src="showcode2.js"></script>
</body>

</html>
85 changes: 85 additions & 0 deletions p5-experiments/plottable/phoenix003.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
function savesvg() {
save("phoenix001.svg");
}

function savepng() {
save("phoenix001.png");
}

var fSize = 17
var bowie
var xoff = 0.0
var xinc = 0.01
var steps = 21
var xstep = actualwidth / steps
var ystep = actualheight / steps

function preload() {
bowie = loadFont("../fonts/1CAMBam_Stick_9.ttf");
sourcecode = loadStrings('phoenix001.js');
}

function draw() {
background(0, 0, 0)
noFill()
stroke(0, 0, 100)
rect(leftmargin, topmargin, actualwidth, actualheight)
rect(0, 0, w, h)
initgrid()
//showgrid()
cactus()
noLoop()
}

var grille = []
function initgrid() {
var x, y
for (i = 1; i < steps; i++) {
x = leftmargin + i * xstep + noise(xoff) * (xstep*0.42-xstep); xoff += xinc
for (j = 1; j < steps; j++) {
y = topmargin + j * ystep + random(xoff) * (ystep*0.42-ystep); xoff += xinc
grille.push({ x: x, y: y })
}
}
}

function showgrid() {
for (var i = 0; i < grille.length; i++) {
ellipse(grille[i].x, grille[i].y, 5, 5)
}
}

function cactus() {

for (i = 0; i < steps -1; i++) {
for (j = 0; j < steps -2; j++) {
var index1 = (i*(steps-1))+j
var index2 = (i*(steps-1))+j+steps-1
var index3 = (i*(steps-1))+j+steps
var index4 = (i*(steps-1))+j+1
for(t=0;t<11;t++){
quad(grille[index1].x,grille[index1].y+t,
grille[index2].x,grille[index2].y-t,
grille[index3].x+t,grille[index3].y,
grille[index4].x-t,grille[index4].y
)
}
}
}
}



function showcredits(posx, posy) {
textFont(bowie)
textSize(fSize);
stroke(0, 0, 100)
fill(0, 0, 100)
var c = "al.my.re [noline 004). 20 September 2024"
text(c, posx, posy)
c = "p5.js :: random() :: juicy-gcode"
text(c, posx, posy + fSize)
c = "pour alice"
text(c, posx, posy + 2 * fSize)

}

0 comments on commit 5d68f27

Please sign in to comment.