xxxxxxxxxx
29
let pg;
let z = 0;
let growing = true;
function setup(){
createCanvas(windowWidth, windowHeight, WEBGL);
frameRate(60);
smooth();
pg = createGraphics(255,255);
pg.background(255, 0, 0);
pg.textAlign(CENTER, CENTER);
pg.textSize(50);
pg.text('Hello world!', 0, 0 ,255, 255);
}
function draw(){
background(200);
if(z < 0) growing = true;
if(z > 500) growing = false;
translate(0, 0, growing ? z++ : z--);
texture(pg);
plane(100);
}