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

141
Visualizações
Converted file from threejs-usdzExporter not shown on Iphone

I have used THREE.js GLTFLoader to load glb file then I used USDZ Exporter to export it to usdz then when I tried to open it on browser it opened on saferi but didn't shown on arkit on object mode and on AR Mode appear above my head this is a simple file

https://drive.google.com/file/d/1uAZNZLWI-zdtjcetfT2tIBh9a0tyzGyi/view?usp=sharing

This is my trial

const loader = new GLTFLoader().setPath(`${origin}${folderPath}`);
        loader.load(modelName, async function (gltf) {

            model = gltf.scene;
            scene.add(model);
      const exporter = new USDZExporter();
            const arraybuffer = await exporter.parse(model );
            const blob = new Blob([arraybuffer], { type: 'application/octet-stream' });

            const link = document.getElementById('usdz-link');
            link.style.display = ''
            link.href = URL.createObjectURL(blob);

also I have tried to center the glb model by this code

        const box = new THREE.Box3().setFromObject(gltf.scene);
        const center = box.getCenter(new THREE.Vector3());
        var sceneCopy=gltf.scene.clone();
        sceneCopy.position.x += (gltf.scene.position.x - center.x);
        sceneCopy.position.y += (gltf.scene.position.y - center.y);
        sceneCopy.position.z += (gltf.scene.position.z - center.z);

and then used sceneCopy to be exported to usdz but unfortunately this didn't help me

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think we answered this one through slack, but I'll repost here for closure..

The offset of the model needs to be close to the origin for it to appear correctly in the quicklook viewer on iPad/iPhone.

You can manually set the offset by changing these three lines... https://github.com/wallabyway/quicklook-example/blob/6f1e1453b983e0effc4ad82b2eda5eac905865a9/alliedbim-piping.gltf#L1023-L1025

which is the opposite of these 3 values:

the opposite to these 3 values: https://github.com/wallabyway/quicklook-example/blob/6f1e1453b983e0effc4ad82b2eda5eac905865a9/alliedbim-piping.gltf#L1044-L1046

Basically, when you use filtering in forge-convert-utils, the center option doesn't take into account the offset.

There is a GitHub repo feature request to fix this...

https://github.com/petrbroz/forge-convert-utils/issues/44

and a branch with a possible solution. https://github.com/petrbroz/forge-convert-utils/commit/bb4bd0a13c685c34966a3bf5c2784ba9b1343a7d

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