p5.js - won't draw texture in quad?

Hi.

Trying to draw a second image inside a quad. Working perfect in processing but not in p5.

preload and setup done:

createCanvas(1135, 720, P2D);

function draw() {

  image(img, 0, 0); // --- first image appears at front

  push();
  texture(imgBack); // --- second image appears inside the quad window

  quad( mouseX, mouseY,
        mouseX + windowsizeX, mouseY,
        mouseX + windowsizeX, mouseY + windowsizeY,
        mouseX, mouseY + windowsizeY );
  pop();
Tagged:

Answers

  • My problem is that in processing second image appears fixed at the background, , like I wanted, as if it was part of the background and the quad windows act like a transparency window over the front image. With p5 doesn't work like that. Second image automatic scale down to quad size...

Sign In or Register to comment.