Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

547
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda