Add completed buffer as texture

This commit is contained in:
Lev
2021-07-24 18:48:53 -05:00
parent 164db871c2
commit 3d408fac3a
3 changed files with 40 additions and 0 deletions

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,23 @@
let buff;
function setup() {
createCanvas(900, 600, WEBGL);
angleMode(DEGREES);
noStroke();
buff = createGraphics(300, 300);
buff.background("white");
}
function draw() {
background(125);
buff.fill(255, 0, 255);
buff.noStroke();
buff.ellipse(random(buff.width), random(buff.height), 10, 10);
texture(buff);
rotateY(frameCount);
//box(200);
sphere(100, 30, 30);
camera(250, -250, 250);
}