Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
Flip image Y axis on p5js

I need to flip a image over the Y axis in P5js

I'm aware that for the flip over the X axis the following code works

push();
scale(-1, 1)
image(pg,-width/2,0, width/2, height);
pop();

But I can't found the way to do it over the Y axis.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Scale the y axis by -1:

scale(1, -1);

And draw the image with a y-coordinate of -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>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda