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

98
Visualizações
raycaster do not generate a known intersection

I just created a simple environment with 2 spheres and making raycast between each other. From A to B I get intersection but not from B to A, why this can happen ?

here a fiddle

objs.forEach(obj => {
    const Object = new THREE.Mesh(new THREE.SphereGeometry(1, 32, 32), new THREE.MeshBasicMaterial({
        color: 0xff0000
    }));
    Object.position.set(obj.pos.x, obj.pos.y, obj.pos.z);
    scene.add(Object);

});

objs.forEach(originObj => { // origin 

    const oPos = new THREE.Vector3(originObj.pos.x, originObj.pos.y, originObj.pos.z);
        
   
    objs.forEach(destinyObj => { // destiny 
    

        if (originObj.id != destinyObj.id) { // only check with the others


            const dPos = new THREE.Vector3(destinyObj.pos.x, destinyObj.pos.y, destinyObj.pos.z);
            
            
            let dir = new THREE.Vector3();
            dir = dir.subVectors(dPos, oPos).normalize();
            
          
            const raycaster = new THREE.Raycaster();
            raycaster.set(oPos, dir);
            
            const intersects = raycaster.intersectObject(scene, true);

        }
    });
});

Thanks in advance

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