xxxxxxxxxx
55
// Load fonts in WEBGL mode by uploading the font-file
// eg. ttf to your Sketch Files
//
// check the Sketch Files and the additional file
// KronaOne-Regular.ttf
//
// You must load and set a font before drawing text.
// See `loadFont` and `textFont` for more details.
//
// if you are using the default renderer, you can use
// the link tag inside the index.html file, see example:
//
// https://editor.p5js.org/sojamo/sketches/yvc00Kv1x
let font;
let xx=0, nx=0;
let yy=0, ny=0;
function preload() {
font = loadFont("ChakraPetch-Bold.ttf");
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
textFont(font);
textSize(windowWidth*0.1);
}
function draw() {
background('#FF003E');
fill(0);
textAlign(CENTER);
push();
let x0 = sin(frameCount*0.05);
let x1 = map(x0,-1,1,0,1);
let x2 = map(x0,-1,1,-1,1);
rotateY(frameCount*0.01);
for (let i = 0; i < 100; i++) {
translate(0,0,i*2)
//translate(0,tan(frameCount*0.01)*100, i*7);
//translate(0,tan(frameCount*0.02)*x2*i, i*7);
//translate(0,x2*100*1, i*7);
rotateX(0);
rotateZ((frameCount*0.01)*i);
fill('#00FF18')
text("laser", 0,0);}
pop();
}