xxxxxxxxxx
47
let angle = 0;
function preload() {
X = loadFont('Inter-Var.ttf');
}
function setup() {
createCanvas(600, 600, WEBGL);
textFont(X);
//fill(0, 200, 0);
//hello = createGraphics (200,200);
//hello.background (255,100);
//hello.fill(255);
//hello.textAlign(CENTER);
//hello.textSize(54);
textSize(width / 3);
textAlign(CENTER, CENTER);
}
function draw() {
let dx= mouseX - width/2;
let dy = mouseY - height/2;
let v = createVector (dx, dy, 0)
v.div(200);
pointLight(0, 0, 255, -200, 0, 0);
pointLight(250, 23, 0, 0, -100, 20);
directionalLight(250, 23, 0, v);
background(0, 250, 250);
translate (mouseX - width/2, mouseY - width/2);
rotateX(angle),
rotateY (angle * .5);
ambientMaterial( 255);
noStroke();
//torus(60, 40);
text('hello', 0, 0);
//texture(hello);
plane (420,420);
angle += 0.01;
}