Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

105
Visualizações
How to make createCapture(VIDEO) image to be absolute among other objects inside code?

I have this p5 project where using camera to output the feed from it in my game, but the camera output seems to say behind game and idk how to make it appear as a first layer to the top of the game. How can I do it? TIA!

Code for camera, I am using but it works here, since there is no game here

let cap;
function setup() {
  createCanvas(400, 400);
  cap = createCapture(VIDEO);
  cap.hide();
  imageMode(CENTER);
}
function draw() {
  background(50);
  image(cap, mouseX, mouseY, 160, 120);
}

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

In p5.js there are no layers or stacking order. In 2d mode elements are stacked in the order they are drawn. So the first thing you draw will be the bottom most, and the last thing you draw will be the top most. In WEBGL mode everything you draw does have a z position and each element may be hidden or clipped if it is behind things already drawn in the same frame. In between frames something called the "depth buffer" is cleared so that all elements drawn on the next frame will be displayed without regard for the elements drawn in the previous frame.

You can actually clear the depth buffer during a single frame to simplify layering things in WEBGL. For more info see this answer.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda