Add box with texture
This commit is contained in:
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