# Clipping planes in Mesh\_basic\_material

**URL:** <https://discourse.threejs.org/t/clipping-planes-in-mesh-basic-material/70069>\
**Category:** Questions\
**Tags:** clipping-planes, materials, shaders\
**Created:** [August 29, 2024, 2:49pm UTC](https://discourse.threejs.org/t/clipping-planes-in-mesh-basic-material/70069 "2024-08-29T14:49:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SINDHU\_M](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sindhu_m/32/43871_2.png) [@SINDHU\_M](https://discourse.threejs.org/u/SINDHU_M)\
**Post date:** [August 29, 2024, 2:49pm UTC](https://discourse.threejs.org/t/clipping-planes-in-mesh-basic-material/70069/1 "2024-08-29T14:49:33Z")

</div>

Hi, i created a mesh, using the meshbasicmaterial, and i tried to apply clipping for it.It is cliiping, but after certain clipping, if i try to move the mesh, the clipped parts are still visible

return new THREE.MeshBasicMaterial({  
color: color ?? generateMetallicColor(),  
side: THREE.DoubleSide,  
clippingPlanes: clippingPlanes,  
wireframe: true,  
transparent: false,  
opacity: 1,  
clipShadows: true,  
});

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [August 29, 2024, 5:49pm UTC](https://discourse.threejs.org/t/clipping-planes-in-mesh-basic-material/70069/2 "2024-08-29T17:49:39Z")

</div>

The planes are relative to the global space. They are not local to the object where they are used as clipping planes. To solve your issue, you have to recalculate the clipping planes whenever the object moves or rotates.

I’m not sure what is the best way to do this. I could only come up with this ugly solution:

[https://codepen.io/boytchev/full/vYqaMxJ](https://codepen.io/boytchev/full/vYqaMxJ)

[![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/3/a/3a738c315125afc3006d4c268fa569fe751b6157.png)](https://codepen.io/boytchev/full/vYqaMxJ)

PS. It is always considered polite and respectful when you format your code as code (instead of pouring it as text) and when you also provide an online debuggable program demonstrating the issue.
