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

217
Vistas
How to add a hyperlink to a object loaded using GLTF loader?

I want to add hyperlink to the object added using gltf loader, is it possible to add one in this code?

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 Respuestas
Responde la pregunta

0

Adding hyperlinks to 3D objects is not possible.

The common approach is to use raycasting to detect interaction with a model. You can then navigate the user to a different URL by setting window.location.href in JavaScript.

If you need a complete example that shows how to use raycasting in three.js for implementing interaction, have a look at webgl_interactive_cubes.

about 4 years ago · Juan Pablo Isaza Denunciar

0

As @Mugen87 stated,

The common approach is to use raycasting to detect interaction with a model.

Since hyperlinks are typically triggered on click, use the click event listener of JavaScript.

Once you determine that the model was clicked on, you just set window.location.href = 'https://example.com/

That should do it~

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