Update completed

This commit is contained in:
Lev
2021-06-27 00:32:39 -05:00
parent 895935ec36
commit 817d6ed818
5 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>graphicsProgramming - Coursera</title>
<script src="libraries/p5.min.js" type="text/javascript"></script>
<script src="libraries/p5.sound.min.js" type="text/javascript"></script>
<script src="sketch.js" type="text/javascript"></script>
<style> body {padding: 0; margin: 0;} canvas {vertical-align: top;} </style>
</head>
<body>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,39 @@
//////////////////////////////////////////////////
// COURSERA GRAPHICS PROGRAMMING
//////////////////////////////////////////////////
function setup() {
createCanvas(200, 200);
background(0);
rectMode(CENTER);
}
//////////////////////////////////////////////////
function draw() {
background(0);
//randomGrid();
noiseDetail(map(mouseY, 0, height, 0, 5));
noisyGrid();
}
///////////////////////////////////////////////////
function randomGrid(){
for (var x=0; x<width; x+=1){
for (var y=0; y<height; y+=1){
var c = random(0, 255);
stroke(c)
point(x, y);
}
}
noLoop();
}
///////////////////////////////////////////////////
function noisyGrid(){
for (var x=0; x<width; x+=1){
for (var y=0; y<height; y+=1){
var n = noise(map(mouseX, 0, width, x/10, x/100), map(mouseX, 0, width, y/10, y/100));
var c = map(n, 0, 1, 0, 255);
stroke(c)
point(x, y);
}
}
}