const clipPlanes = [
new THREE.Plane(new THREE.Vector3(1, 0, 0), -50),
new THREE.Plane(new THREE.Vector3(-1, 0, 0), -50),
new THREE.Plane(new THREE.Vector3(0, 0, -1), -10),
new THREE.Plane(new THREE.Vector3(0, 0, 1), -10),
]
const animate = () => {
deltaTime.value = colck.getDelta()
if (tilesRuntime.value) {
console.log(tilesRuntime.value)
scene.traverse((obj: any) => {
if (obj.type == "Mesh") {
if (obj.material.length > 1) {
obj.material.forEach((element: any) => {
element.clippingPlanes = clipPlanes;
element.clipIntersection = true;
});
} else {
obj.material.clippingPlanes = clipPlanes;
obj.material.clipIntersection = true;
}
}
})
tilesRuntime.value.update(deltaTime.value, renderer, camera)
}
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
I got the effect I wanted, but I put the clip's code in the animate, This may seem like a poor performance. Is there a better way?@wanyanyan @Avnerus

I want Clip the model,Here is what I tried
I got the effect I wanted, but I put the clip's code in the animate, This may seem like a poor performance. Is there a better way?@wanyanyan @Avnerus
