Trasformazioni spaziali
// height=300 lines=auto
let bitmap;
function preload() {
bitmap = loadImage("assets/eyes_bn.jpg");
}
function setup() {
createCanvas(670,300);
}
function draw() {
// TRASFORMAZIONE SPAZIALE //////////////////////////////////
shearX( sin(frameCount/40) / 6 );
image( bitmap, 0, 0 );
}
shearX( sin(frameCount/40) / 6 );
Attiva uno "stiramento" orizzontale delle forme che verranno disegnate in seguito. L'entità dello "stiramento" oscillerà con un andamento sinusoidale: sin(frameCount/40).
Strutturazione dei file:
- CARTELLA-SKETCH
- assets
- libs
- p5.min.js
- index.html
- sketch.js