Clipping with edges on

I have a draggable clipping plane. https://playground.babylonjs.com/#S2NTDA#7

I want the edges to show in the model where the clipping is happening.


Similar to this image.

Can you please help me achieve this?

You can try to fake it by setting a different color for points that are near the clip plane:

I have used a material plugin in this PG to just do that.

3 Likes

That is quite an interesting solution, but can we get the exact edges that are interesting with the plane?

This isn’t easy, as rendering is done in the shader, so there are no edges generated as such.

To generate the list of edges, you’d have to perform calculations to determine the intersection between the plane and all the faces in the mesh.

1 Like