I want to pick a face in a mesh when clicking on it with the mouse. The mesh is loaded using ObjLoader and MtlLoader (attached) When clicking on the mesh, sometimes an intersection is detected, but sometimes not.
Attached here is a small self-contained example that is based on webgl_interactive_cubes.html and the .obj file. If setting the variable loadCubes to true the original example runs as expected, i.e. intersections are detected. If setting the variable loadCubes to false, the obj file is loaded but the intersections are not detected.
Thanks, Avner
p.s. Related links that I looked at: similar problem description: here and here, code pattern, raycasting documentation