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

176
Visualizações
How can I take a screenshot of scene with childrens in a particular camera positions even after moving the scene of HTML page in Three.js?

In an HTML page using Three.js, I developed a scene of a product which contains multiple GLTFLoader childrens. The product parts can be updated. How can I take a screenshot of a product in a particular camera position even after it moved or rotated?

The screenshot should contain the product maximum size.

function toDataURL(strMime){
    let curVector = camera.position.clone();
    // camera.up - test
    // let worldDir = camera.getWorldDirection();
    // var vector = new THREE.Vector3( 0, 0, -1 );
    // vector.applyQuaternion( camera.quaternion );
    // let camTarget = camera.target.position.clone();
    // let curMatrix = camera.matrix.clone();
    let vector = new THREE.Vector3( 0, 0, - 1 );
    console.log('curVector',camera.clone());
    vector.applyQuaternion( camera.clone().quaternion );
    camera.position.set( - 2.8, 1.0, - 3.7 );
    camera.lookAt(0,0,0);
    render();
    let imgData = renderer.domElement.toDataURL(strMime);
    camera.position.set( curVector.x, curVector.y, curVector.z );
    camera.lookAt(0,0,0);
    render();
    console.log('after camera', camera)
    return imgData;
}

the image taken not viable because the distance of the scene is too far from from camera or the scene is too small, the distance of the scene is too short or the scene is too large, how can set camera such that image of the scene in the canvas and not too small but inside the canvas, also camera take square image?

about 4 years ago · Juan Pablo Isaza
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