How do I fill in the polygon?

Hello, I’m creating a polygon and I’m going to control it with a rail. The control point coincides with the inside of the polygon. It is formed at the rail checkpoint. Since the polygon is empty, the ray does not realize that it has hit the polygon. How can I fill in the polygon? I request your help.

FaceUVs on Polygon | Babylon.js Playground (babylonjs-playground.com)

I’m not sure to understand. Do you mean that a ray that is inside a mesh but doesn’t intersect with any polygon is reporting to not hit anything?

Sorry for the broken english. Yes, that’s what I want to say. Is this possible

There’s no notion of volume for a mesh. There’s only a list of faces (triangles), and the intersection function checks if the ray hits at least one face or not.

If you want to know if a point is inside a mesh, you can try to use this function:

2 Likes

if no there is no intersection between ray/triangle then no hit can be detected.
This said, it’s possible to detect if a point is inside a convex hull by testing the point against all planes normal.

2 Likes