xxxxxxxxxx
81
// Define the variable to store the graphics
let graphics;
let font;
var x;
function preload (){
font = loadFont("Monoton-Regular.ttf");
font1 = loadFont("AllertaStencil-Regular.ttf");
}
function setup() {
// Set the canvas
createCanvas(1920, 1080, WEBGL);
// Create a new graphics renderer
graphics = createGraphics(200, 200);
graphics1 = createGraphics(200,200);
}
function draw() {
background(0);
// Add the required objects to the
// graphics buffer
graphics.background(0)
graphics.fill( 88, 107, 166);
graphics.textFont(font);
graphics.textSize(40);
graphics.text('GIVE UP',0,100);
// graphics1.background(None);
graphics1.fill(242, 203, 5);
graphics1.textFont(font1);
graphics1.textSize(12);
graphics1.text('NOTHING MATTERS',0,100);
// ambientLight(20);
// pointLight(255, 255, 255, 150, 30, 0);
// rotateZ(frameCount * 0.02);
// rotateY(frameCount*0.01);
texture(graphics);
// Use a box for the texture
// cylinder(50)
push();
rotateY(frameCount * 0.01);
rotateX((frameCount*0.01));
for (let i=0;i<20;i++) {
noStroke();
box(100);
translate(-100+(i*10),0,-0);
}
pop();
texture(graphics1)
push();
rotateX(frameCount * 0.01);
rotateY(cos(frameCount*0.01));
for (let i=0;i<30;i++) {
// translate(50*cos(frameCount*i*0.001),120,50*i,50*i)
noStroke();
box(150);
translate(-115+(i*10),0,-0);
camera(110,380,60);
}
pop();
camera(10,180,60);
}