Add Initial commit
This commit is contained in:
17
CM2030 Graphics Programming/Topic 1/1.3.1b/index.html
Normal file
17
CM2030 Graphics Programming/Topic 1/1.3.1b/index.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>randomDot</title>
|
||||||
|
<script src="libraries/p5.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<script src="libraries/p5.dom.js" type="text/javascript"></script>
|
||||||
|
<script src="libraries/p5.sound.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>
|
||||||
3031
CM2030 Graphics Programming/Topic 1/1.3.1b/libraries/p5.dom.js
Normal file
3031
CM2030 Graphics Programming/Topic 1/1.3.1b/libraries/p5.dom.js
Normal file
File diff suppressed because it is too large
Load Diff
36
CM2030 Graphics Programming/Topic 1/1.3.1b/libraries/p5.min.js
vendored
Normal file
36
CM2030 Graphics Programming/Topic 1/1.3.1b/libraries/p5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12873
CM2030 Graphics Programming/Topic 1/1.3.1b/libraries/p5.sound.js
Normal file
12873
CM2030 Graphics Programming/Topic 1/1.3.1b/libraries/p5.sound.js
Normal file
File diff suppressed because it is too large
Load Diff
26
CM2030 Graphics Programming/Topic 1/1.3.1b/sketch.js
Normal file
26
CM2030 Graphics Programming/Topic 1/1.3.1b/sketch.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
function setup() {
|
||||||
|
createCanvas(720, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
function draw()
|
||||||
|
{
|
||||||
|
background(0, 150, 200);
|
||||||
|
drawCat(mouseX, mouseY);
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawCat(x, y)
|
||||||
|
{
|
||||||
|
rectMode(CENTER);
|
||||||
|
stroke(0);
|
||||||
|
strokeWeight(2);
|
||||||
|
translate(x, y);
|
||||||
|
fill(255);
|
||||||
|
|
||||||
|
rect(0, 0, 100, 100); // face
|
||||||
|
rect(-20, -20, 25, 10); // left eye
|
||||||
|
rect(20, -20, 25, 10); // right eye
|
||||||
|
rect(0, 5, 7, 25); // nose
|
||||||
|
rect(0, 30, 30, 5); // mouth
|
||||||
|
triangle(-50, -50, -30, -70, -10, -50);
|
||||||
|
triangle(50, -50, 30, -70, 10, -50);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user