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

216
Views
¿Cómo agregar un hipervínculo a un objeto cargado con el cargador GLTF?

Quiero agregar un hipervínculo al objeto agregado usando gltf loader, ¿es posible agregar uno en este código?

 var loader = new THREE.GLTFLoader(); var mesh; loader.load('globe.glb', function(gltf){ console.log(gltf); mesh = gltf.scene; console.log(mesh.children[0]); mesh.children[0].material = new THREE.MeshLambertMaterial(); mesh.position.z = z; mesh.position.x = x if(x!=0){ gltf.scene.scale.set(0.5,0.5,0.5) } if(y==1){ mesh.position.y = x } if(y==2){ mesh.position.y = -1*x } scene.add( mesh ); });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No es posible agregar hipervínculos a objetos 3D.

El enfoque común es usar raycasting para detectar la interacción con un modelo. Luego puede llevar al usuario a una URL diferente configurando window.location.href en JavaScript.

Si necesita un ejemplo completo que muestre cómo usar raycasting en three.js para implementar la interacción, eche un vistazo a webgl_interactive_cubes .

about 4 years ago · Juan Pablo Isaza Report

0

Como dijo @Mugen87,

El enfoque común es usar raycasting para detectar la interacción con un modelo.

Dado que los hyperlinks generalmente se activan al hacer clic, use el detector de eventos de click de JavaScript.

Una vez que determine que se hizo clic en el modelo, simplemente configure window.location.href = 'https://example.com/

Eso debería hacerlo ~

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