We're trying to implement a section tool in Threebox, and it appears that we cannot add a clipping plane (THREE.Plane()) to tb, via tb.Object3D() or tb.add(). I'm assuming it's because a THREE.Plane is more of a math concept than a 3D geometry.
This has the unfortunate consequence that the clipping plane does not pan with the rest of the view. So when the map is panned, the clipping planes start cutting other things.
Is there any ways around this in tb, where the clipping plane would stay fixed ?
Relevant code snippet here :
var plane = new THREE.Plane(new THREE.Vector3(0, 1, 0), -50);
var material = new THREE.MeshNormalMaterial({
clippingPlanes: [plane],
side: THREE.FrontSide,
clipShadows: true,
});
var sphere = window.tb
.sphere({ radius: 5, material: material })
.setCoords(basePoint);
window.tb.add(sphere);
tb.renderer.localClippingEnabled = true;
sandbox
Clipped sphere pre-pan:
Clipped sphere post-pan: