Add Initial commit
This commit is contained in:
15
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/index.html
Normal file
15
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/index.html
Normal 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>
|
||||
3
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/libraries/p5.min.js
vendored
Normal file
3
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/libraries/p5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
28
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/libraries/p5.sound.min.js
vendored
Normal file
28
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/libraries/p5.sound.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
22
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/sketch.js
Normal file
22
CM2030 Graphics Programming/Topic 6/6.3.3 3DNoise/sketch.js
Normal file
@ -0,0 +1,22 @@
|
||||
function setup() {
|
||||
createCanvas(200, 200);
|
||||
background(0);
|
||||
rectMode(CENTER);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
background(0);
|
||||
|
||||
noisyGrid();
|
||||
}
|
||||
|
||||
function noisyGrid(){
|
||||
for (var x=0; x<width; x+=1){
|
||||
for (var y=0; y<height; y+=1){
|
||||
var n = noise(x/100, y/100, frameCount/100);
|
||||
var c = map(n, 0, 1, 0, 255);
|
||||
stroke(c)
|
||||
point(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user