Now when you render, the two shapes, they will clip in different directions, exposing only their "side" of the sliced shape. Let clipPlane2 = new Plane().setFromNormalAndCoplanarPoint( normal, localPosition ) Let clipPlane1 = new Plane().setFromNormalAndCoplanarPoint( normal, localPosition ) Let normal = new Vector3(0, 1, 0) // +Y as an example (Note: The normal points in the direction that the clipping plane will KEEP visible.) let localPosition = new Vector3() This is done through the Material (which is why you needed a clone and not a reference). Now, you want to create two clipping planes, "facing" in opposite directions, and set one on your original mesh, and the other on the clone. let clonedMesh = yourMesh.clone()ĬlonedMesh.material = () ALSO, clone and set the material of the copy. Ideally you would create an instance of the Mesh, but the idea is that you have a copy of the shape. This will allow you to clip a mesh without affecting another mesh. There are two ways to do this: Cloning and Clipping planesįirst, turn on local clipping planes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |