Trying to figure out how to mask a mesh with another. Unfortunately have not found much information related to this topic. There is a threejs official example of this, but it uses the built-in clipping planes to mask the mesh, not another mesh. I would like to eventually play with this concept using instanced meshes.
What I’d like to do is mask the blue box, only showing the blue box (mesh3) where it overlaps with the other 2 meshes (mesh1, mesh2). Been fiddling around w/ this a lot, seems like I need to render the mask as 2 separate meshes w/ front/back sides. The commented line: “mesh2.position.x = -50;”: if I uncomment that, its not giving me the result I’m looking for, so leaving that as it is to better show what I’m trying to achieve; The “doStencil” boolean can be changed to false to see the meshes rendered w/o stenciling.
Any help/direction would be greatly appreciated. Thanks in advance.