1.剖切整体,直接设置渲染器的全局剖切面,空间中与该平面点积为负的点将被切掉。
const globalPlane = new THREE.Plane( new THREE.Vector3( - 1, 0, 0 ), 0.1 );
renderer.clippingPlanes = [globalPlane];
2.剖切某个对象,设置该对象的材质的剖切面,并设置渲染器开启对象级剖切。
const localPlane = new THREE.Plane( new THREE.Vector3( 0, - 1, 0 ), 0.8 );
material.clippingPlanes = [localPlane];
renderer.localClippingEnabled = true;
3.设置被剖切物体阴影是否受影响。
material.clipShadows = true;
4.多个剖切面同时剖切,仅剖切交集部分
material.clipIntersection = true;