Add box with texture

This commit is contained in:
Lev
2021-07-24 18:28:30 -05:00
parent 42fd5884bd
commit 164db871c2
4 changed files with 35 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

View File

@ -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>

File diff suppressed because one or more lines are too long

View 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);
}