Hello!
I was hoping someone could explain this to me.
I have a box mesh and a sphere mesh some distance from it. I calculate the facets for the box mesh and determine the closest facet to the sphere. I then cast a blue ray to each facet, except the closest which gets a red ray.
Here’s the playground: https://www.babylonjs-playground.com/#LQHH9A#1
You’ll have to rotate the camera some to see things (can someone explain that, too? why my rays seem to disappear when moving the camera around?).
I’ve used this code before and gotten what I thought was correct results, but then I saw sometimes things seemed off. This playground shows the red ray does not have the shortest distance between sphere and facet (so not the closest, right?) Is there a way to highlight the edges of the facets with something like the edgerenderer?
Thanks so much,
Carlos