audiv027-2024-2

clase 11

let captura;

let opciones = {
  video: {
    facingMode: "environment",
  },
  audio: false,
};


function setup() {
  createCanvas(windowWidth / windowHeight);
  console.log(windowWidth);
  captura = createCapture(opciones);
  captura.hide();
  image(captura, 0, 0);
}

function draw() {
  background(255, 0, 0);
  // image(captura, mouseX, mouseY);
  image(captura, 0, 0, windowWidth, windowHeight);
}

function windowResized() {
  console.log("cambio la pantalla");
  resizeCanvas(windowWidth / windowHeight);
}

function fantasia() {
  console.log("fantasiaaa");
}
let captura;

let opciones = {
  video: {
    facingMode: "environment",
  },
  audio: false,
};


function setup() {
  createCanvas(windowWidth / windowHeight);
  console.log(windowWidth);
  captura = createCapture(opciones);
  captura.hide();
  // image(captura, 0, 0);
}

function draw() {
  // background(255, 0, 0);
  // image(captura, mouseX, mouseY);
  // image(captura, 0, 0, windowWidth, windowHeight);

  if (touches.length == 2) {
    let deditoIzqX = touches[0].x;
    let deditoIzqY = touches[0].y;
    let deditoDerX = touches[1].x;
    let deditoDerY = touches[1].y;
  
      // ellipse(dedito.x, dedito.y, 180, 180);
      image(captura, deditoIzqX, deditoIzqY, deditoDerX, deditoDerY);
    }
  }
}

function windowResized() {
  console.log("cambio la pantalla");
  resizeCanvas(windowWidth / windowHeight);
}

function fantasia() {
  console.log("fantasiaaa");
}