use ThreeJS’s ClippingPlanes. But when I exported the scene using GLTFExporter, I found that the generated GLTF file cannot save the clipping effect.
This is my code
const geometry = new THREE.SphereGeometry( 200, 64, 32 );
const material = new THREE.MeshPhongMaterial({
color: 0xe63a43,
specular: 0x614e4e,
shininess: 100,
side: THREE.DoubleSide,
clippingPlanes: [
new THREE.Plane(new THREE.Vector3(0, -1, 0), -10)
],
clipIntersection: true
});
const meshItem = new THREE.Mesh( geometry, material );
Yes, not all feature of three.js can be saved to standard (engine-agnostic) formats. Clipping planes are one such feature. If you only need to reload this export in three.js, you could use object.toJSON()
instead, and load the result with THREE.ObjectLoader.
Thank you, Hope there are other solutions