xxxxxxxxxx
42
let angle = 0;
let graphics;
function setup() {
noStroke();
noFill();
setAttributes('antialias', true);
setAttributes('alpha', false);
createCanvas(600, 600, WEBGL);
graphics = createGraphics(300, 300);
graphics.textFont('Ubuntu');
graphics.textAlign(CENTER, CENTER);
graphics.textSize(96);
graphics.textStyle(BOLD);
graphics.fill(255,40);
graphics.noStroke();
graphics.text('123',graphics.width/2, graphics.height/2);
}
function draw() {
// background(20);
noStroke();
// ambientLight(100);
// directionalLight(255, 255, 255, 0, 0, -1);
directionalLight(255, 0, 0, 0, -1, 0);
directionalLight(0, 255, 0, -1, 0, 0);
directionalLight(0, 0, 255, 0, 0, -1);
rotateX(angle);
rotateY(angle * 1.3);
rotateZ(angle * 0.7);
texture(graphics)
for(let i = 0; i < 3; i++){
box(i*200);
}
angle += 0.02;
}