Add Initial commit
This commit is contained in:
@ -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>
|
||||
BIN
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/libraries/.DS_Store
vendored
Normal file
BIN
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/libraries/.DS_Store
vendored
Normal file
Binary file not shown.
3
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/libraries/p5.min.js
vendored
Normal file
3
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/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.2.1 Noise101/libraries/p5.sound.min.js
vendored
Normal file
28
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/libraries/p5.sound.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
26
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/sketch.js
Normal file
26
CM2030 Graphics Programming/Topic 6/6.2.1 Noise101/sketch.js
Normal file
@ -0,0 +1,26 @@
|
||||
let time = 0;
|
||||
|
||||
function setup() {
|
||||
createCanvas(900, 600);
|
||||
background(0);
|
||||
rectMode(CENTER);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
background(0);
|
||||
|
||||
let nX = noise(time);
|
||||
let locX = map(nX, 0, 1, 0, width);
|
||||
let nY = noise(time + 5);
|
||||
let locY = map(nY, 0, 1, 0, height);
|
||||
translate(locX, locY);
|
||||
|
||||
|
||||
|
||||
rotZ = map(nX, 0, 1, -25, 25);
|
||||
rotate(rotZ);
|
||||
let color = map(nX, 0, 1, 0, 150);
|
||||
fill(color, 0, 0);
|
||||
rect(0, 0, 150, 150);
|
||||
time+=0.01;
|
||||
}
|
||||
Reference in New Issue
Block a user