Ray picking and mesh encapsulated meshes

Say I have an OBJ file with meshes that display a series of cubes in a straight line that is encapsulated by a cylinder. No mesh is touching another.

I then have a tiny sphere outside the cylinder. Now if I attempt to use a ray to pick the nearest mesh to the sphere, I should receive the cylinder, correct? the ray should hit the cylinder before it hits the boxes, right?

image

The problem is that it is not. Its like the ray doesn’t acknowledge the outside cylinder. I AM, however, getting the closest cube inside the cylinder. So I’m worndering, is there a property on the cylinder I might have switched by accident? Like an “Ignore me if you’re a ray” property?

Maybe the bounding box of the cylinder is not setup properly? I guess we would need a repro to help more.

i think that was actually it. i resized my outer object some and re-exported. works fine now, thank you!

1 Like