Boundary of meshes

Hi,

My scene is a 3D scene. Assume that I have taken a screenshot of my scene. I need to erase few meshes from the screenshot. (Hiding the meshes and taking a screenshot is not OK for me).

So, what I need is, the 2D polygon(s) of each mesh. How can I achieve that?

Thanks in advance.

Woot, this seems really complex. To get that info, you kind of need to project (using Vector3.Project) all vertices and then build a polygon from that

That does not seem to be the more efficient :slight_smile:

I need this. Any code sample?

Nope :frowning: But easy to do. Just run through the list of vertices and call Vector3.Project

1 Like

Looking at glow layer code may give some simple and clean approach?

I do not think so as the glow layer is using the depth renderer and thus will require a render. What you need seems more geometric

If you can render the scene again then just hide the objects you don’t want :wink:

How about creating two screenshots, one full and one with just the meshes you want to erase, and then use the latter for erasing?

1 Like

Yeah. This is the solution which is in my mind at this point. I want to capture screenshots of every mesh (by hiding other n-1) meshes. From each image, find the boundary of the mesh(as non-mesh pixels will have the transparent color). Save this data and use it further.

But, I somehow feel like we need to go with a mathematical approach like professionals.