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

99
Vistas
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 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