xxxxxxxxxx
39
/**
* This example has yet to be ported to GLOBAL mode for reference here, sorry! :)
* Right now, it only displays the sketch used in example `0_basic`.
* The INSTANCE mode version can be found here to run locally:
* https://github.com/humanbydefinition/p5.asciify/tree/main/examples/asciishift
*/
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL); // WebGL mode is required
}
function setupAsciify() {
p5asciify.fontSize(8); // Update the font size
// Update the character set used for the default "brightness" renderer
p5asciify.renderers().get("brightness").update({
characters: " .:-=+*#%@",
});
}
function draw() {
/**
Your creative code goes here to replace the following code, drawing to the graphic buffer.
Currently, the code draws a Tim Rodenbroeker-esque rotating 3D box to the graphic buffer.
Check out his courses on creative coding at https://timrodenbroeker.de/ (no affiliation, I just enjoyed his courses)
**/
background(0);
fill(255);
rotateX(radians(frameCount * 3));
rotateZ(radians(frameCount));
directionalLight(255, 255, 255, 0, 0, -1);
box(800, 100, 100);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}