# Loosing half of the Plane when using clipping

**URL:** <https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832>\
**Category:** Questions\
**Created:** [January 17, 2022, 7:31am UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832 "2022-01-17T07:31:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [January 17, 2022, 7:31am UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832/1 "2022-01-17T07:31:43Z")

</div>

Hello!

Why is the plane clipped in this PG?

> **[Babylon.js Playground](https://playground.babylonjs.com/#284CRU%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

But the box of the same size is not clipped and works as expected? (same PG, just uses a box instead a plane)

> **[Babylon.js Playground](https://playground.babylonjs.com/#284CRU)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Thanks a lot!

🖖

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 17, 2022, 10:36am UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832/2 "2022-01-17T10:36:04Z")

</div>

`onBeforeBindObservable` is too late in the process, the clip planes have already been setup in the material at that time. You should use `onBeforeRenderObservable` instead:

> **[Babylon.js Playground](https://playground.babylonjs.com/#284CRU%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [January 17, 2022, 10:41am UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832/3 "2022-01-17T10:41:51Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [January 17, 2022, 12:11pm UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832/4 "2022-01-17T12:11:23Z")

</div>

I’d like to ask why is it working for the box but not for the plane?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 17, 2022, 12:47pm UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832/5 "2022-01-17T12:47:30Z")

</div>

It is working with the box because as there is a depth (even if very small), the face of the cube which would contain the (0,0,0) point is a little further on the x axis (0.005), so the clipping plane which is in effect when the box is drawn (with (-1,0,0,0) normal) does not clip this face.

If you move the plane further on the X axis you will see it also works with the plane:

> **[Babylon.js Playground](https://playground.babylonjs.com/#284CRU%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [January 17, 2022, 12:50pm UTC](https://forum.babylonjs.com/t/loosing-half-of-the-plane-when-using-clipping/26832/6 "2022-01-17T12:50:17Z")

</div>

Got it! 😉
