xxxxxxxxxx
47
// let myFont;
// function preload() {
// myFont = loadFont('Roboto Mono');
// }
function setup() {
createCanvas(600, 600, WEBGL);
}
function draw() {
background(0);
//move mouse to change light direction
let dirX = (mouseX / width - 0.5) * 2;
let dirY = (mouseY / height - 0.5) * 2;
directionalLight(255, 255, 255, -dirX, -dirY, -1);
noStroke();
translate(0, 20);
sphere(110, 100, 100);
push();
translate(0, 220);
rotateX(8);
torus(190, 70, 100, 100);
pop();
translate(0, -340);
cylinder(150, 380, 100, 100, 0, 0);
// fill('#ED225D');
// textFont('Roboto Mono');
// textSize(36);
// text('p5*js', 10, 50);
}
// function Msg(){
// noStroke();
// fill(0);
// textSize(12);
// textFont(myFont);
// text('punch', width/2, 10);
// function drawText(myFont) {
// fill('#ED225D');
// textFont(myFont, 36);
// text('p5*js', 10, 50);
// }