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 8/8.3.3 Additive Synthesis Circle/libraries/.DS_Store
vendored
Normal file
BIN
CM2030 Graphics Programming/Topic 8/8.3.3 Additive Synthesis Circle/libraries/.DS_Store
vendored
Normal file
Binary file not shown.
3
CM2030 Graphics Programming/Topic 8/8.3.3 Additive Synthesis Circle/libraries/p5.min.js
vendored
Normal file
3
CM2030 Graphics Programming/Topic 8/8.3.3 Additive Synthesis Circle/libraries/p5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
28
CM2030 Graphics Programming/Topic 8/8.3.3 Additive Synthesis Circle/libraries/p5.sound.min.js
vendored
Normal file
28
CM2030 Graphics Programming/Topic 8/8.3.3 Additive Synthesis Circle/libraries/p5.sound.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,26 @@
|
||||
function setup() {
|
||||
createCanvas(550,550);
|
||||
background(0);
|
||||
angleMode(DEGREES);
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
function draw() {
|
||||
background(0);
|
||||
noStroke();
|
||||
fill(255,0,255);
|
||||
|
||||
translate(width/2,height/2);
|
||||
|
||||
//ADDITIVE SYNTHESIS IN A CIRCLE
|
||||
var radius = 150;
|
||||
beginShape();
|
||||
for (var theta=0; theta<360; theta+=1){
|
||||
var wave1 = 0;// your sine code here
|
||||
var wave2 = 0;// your noise code here
|
||||
var r = radius + wave1 + wave2;
|
||||
var x = cos(theta) * r;
|
||||
var y = sin(theta) * r;
|
||||
vertex(x,y);
|
||||
}
|
||||
endShape(CLOSE);
|
||||
}
|
||||
Reference in New Issue
Block a user