I have to generate random points that must be inside a mesh (.obj): how can i do this??
Thanks in advance,
Mike.
I have to generate random points that must be inside a mesh (.obj): how can i do this??
Thanks in advance,
Mike.
Can do this with maths if your mesh is convex. If it’s offlline or not speed critical you could think about raycasting it from 6 directions and then:
This can still be broken for meshes with holes in them but it should work fine. It won’t be 100% though and its not the fastest route.
If unity has a meshes overlap function which supports meshes enclosed in meshes, use that. I’m still a newbie at unity.