Clipping through XZ plane on range slider

Hello,
I want to clip my mesh data through XZ plane (along Y-Plane) using range slider.
I saw threejs example of clipping.

https://threejs.org/examples/?q=cli#webgl_clipping

I tried that functionality but not able to clip the mesh through range slider.
But able to clip that mesh using dat.gui folder.
I send the screenshot which i want ,
Clip
Please give me suggestion .
Thanks.

Are you looking for something like this?

https://jsfiddle.net/voywz4sj/

After defining the markup of your slider, do this in your JavaScript:

const slider = document.getElementById( 'slider' );
	
slider.addEventListener( 'input', ( event ) => {
	
    const value = parseFloat( event.target.value );
	
    localPlane.constant = value * 0.01;
	
} );
1 Like

Hi,
Thanks for suggestion!!
Your suggested way solve my slider issue however i am getting cut body by default like this:
cut%20body
But i don’t want section cut body by default.
i want full body by default and only cut it after moving slider.

I want one more suggestion,
i have set min and max value of slider as min bounding box and max bounding of body.
but it is not working properly. refer below image
cut%20body1
upper surface is gets cut always.Unable to set min and max value.

Thanks