Notifications
Clear all

[Closed] raymeshgridintersect problems

I’ve been using intersectray for various purposes for a while now but it is getting a bit slow and cubersome for more complex tasks. While ago I found raymeshgridintersect which seems nice enough but I can’t seem to get few things right.

1.It has nodelist property, but if I add one or more nodes as array it just returns “** system exception **” when I try to build the grid. When I use addnode, it works with a single node but if I add more this way the rays will just ignore them. Also the nodelist does not update when using addnode. This is a problem only assuming it is supposed to handle more than one node. Nodelist is at least referring to multiple nodes. All examples I’ve seen so far are only handling single nodes.

2.This function does not return world coordinates of a hit. Those are propably quite easy to calculate manually from the other results but i’m just curious why intersectray does that by default but this one does not.

  1. Barycentric coordinates. I so and so understand what these are and how they can be calculated but I have absolutely no idea what they are good for. I found some websites with overly technical explanations but I really missed the point of why and where these can be used.
2 Replies

That’s right. I’ve been trying RayMeshGridIntersect and have the same question. It’s a strange behaviour.

They can be use to linearly interpolate any per-vertex value (position, normal, colors, etc) across the triangle surface.

Still trying to figure this out. Did some more testing but it just doesn’t seem to work with more than one node. Otherwise it is quite neat though, especially intersecting backfacing :).