Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!