Necesito voltear una imagen sobre el eje Y en P5js
Soy consciente de que para voltear el eje X funciona el siguiente código
push(); scale(-1, 1) image(pg,-width/2,0, width/2, height); pop();Pero no puedo encontrar la manera de hacerlo sobre el eje Y.
Escale el eje y en -1:
scale(1, -1); Y dibuja la imagen con una coordenada y de -height :
image(..., ..., -height, ..., height); let img; function preload() { img = loadImage('https://raw.githubusercontent.com/Rabbid76/graphics-snippets/master/resource/texture/supermario.jpg'); } function setup() { createCanvas(256, 256); } function draw() { push(); scale(1, -1); image(img, 0, -height, width, height); pop(); } <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.min.js"></script>