Add box with texture
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 572 KiB |
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script src="p5.min.js"></script>
|
||||
<script src="sketch.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
3
CM2030 Graphics Programming/Week 12/12.1.1 Texture/p5.min.js
vendored
Normal file
3
CM2030 Graphics Programming/Week 12/12.1.1 Texture/p5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
18
CM2030 Graphics Programming/Week 12/12.1.1 Texture/sketch.js
Normal file
18
CM2030 Graphics Programming/Week 12/12.1.1 Texture/sketch.js
Normal file
@ -0,0 +1,18 @@
|
||||
let img;
|
||||
|
||||
function preload() {
|
||||
img = loadImage('assets/rocks.jpg');
|
||||
}
|
||||
|
||||
function setup() {
|
||||
createCanvas(900, 600, WEBGL);
|
||||
angleMode(DEGREES);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
background(125);
|
||||
texture(img);
|
||||
rotateY(frameCount);
|
||||
box(300);
|
||||
camera(250, -500, 500);
|
||||
}
|
||||
Reference in New Issue
Block a user