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

549
Visualizações
How to load an object file in three.js?

I'm trying to load a .obj file in three.js but I'm having trouble importing the libraries for the object loader. In the console it says THREE.OBJLoader2 is not a constructor. I'm trying to load the file locally.

I also tried loading the .gltf file using the gltfloader library, but I can't seem to import the libraries correctly.

this is the html code to import the OBJLoader script:

<script src="resources/threejs/r105/js/loaders/LoaderSupport.js"></script>
<script src="resources/threejs/r105/js/loaders/OBJLoader2.js"></script>

this is the js code for obj loader:

    const objLoader = new THREE.OBJLoader2();
    objLoader.load('house.obj', (event) => {
    const root = event.detail.loaderRootNode;
    scene.add(root);
});

I also tried to import the libraries locally by creating a GLTFLoader.js file and using

  <script src="GLTFLoader.js"></script> 

but that did not work either.

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