Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Threejs y menús desplegables: ¿Cómo mostrar solo el modelo seleccionado?

Me gustaría mostrar solo el valor seleccionado (en este caso, el modelo 3D) de la opción desplegable. Solo uno seleccionado debe ser visible para la cámara. Aquí está la parte del código con la que estoy atascado:

 const loader = new GLTFLoader().setPath('models/gltf/modeldatabase/'); for (let i = 0; i < prefabcontainer.length; i++) { let prefabResource = prefabcontainer[i]; loader.load(prefabResource, function (gltf) { object = gltf.scene; object.scale.set(5, 5, 5); var select = document.getElementById("selectPrefab"); prefabResource = prefabResource.replace(/\..+$/, ''); var prefabElement = document.createElement("option"); prefabElement.textContent = prefabResource; prefabElement.value = prefabResource; select.appendChild(prefabElement); scene.add(object); render(); }, undefined, function (error) { console.error(error); }) }

Prefabcontainer es solo un simple script js:

 let prefabcontainer = [ 'shotgun.gltf', 'pistol.gltf']; export{prefabcontainer};

Y aquí está la parte html:

 <div><select id="selectPrefab">

Agradezco su ayuda, gracias!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!