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

218
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
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