# I set all the material to \`backFaceCulling = false;\` but when I panning the camera my meshes cutting and go to vanish, how can I solve this problem

**URL:** <https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362>\
**Category:** Questions\
**Tags:** material\
**Created:** [July 14, 2021, 7:20am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362 "2021-07-14T07:20:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arash\_Bagheri](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Arash\_Bagheri](https://forum.babylonjs.com/u/Arash_Bagheri)\
**Post date:** [July 14, 2021, 7:20am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/1 "2021-07-14T07:20:53Z")

</div>

hello everyone

I have some meshes and the camera can zoom to the mouse cursor. when I am panning near the meshes, they start to vanish.

 ![Screenshot 2021-07-14 at 08.09.24](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/1/c1c6b8cdb6b51a30f4475562bf34ba11b3d9f899.png)

 ![Screenshot 2021-07-14 at 08.08.14](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/6/36d2013cf77dfbd4f593ffd09a211567386e2f69.png)

here is my PG: [https://playground.babylonjs.com/#EBPQH9#80](https://playground.babylonjs.com/#EBPQH9#80)  
how can i solve this problem?

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [July 14, 2021, 11:12am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/4 "2021-07-14T11:12:11Z")

</div>

I have a try, but it didn’t work, ummmm I find that camera.\_updateFrustumPlanes() never use to update frustumPlanes, it is too confuse

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 14, 2021, 3:24pm UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/5 "2021-07-14T15:24:27Z")

</div>

Sorry but your PG does not look like your screenshot ☹ What should we do in the PG to repro your issue?

---

<div class="post-metadata">

**Author:** ![Arash\_Bagheri](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Arash\_Bagheri](https://forum.babylonjs.com/u/Arash_Bagheri)\
**Post date:** [July 15, 2021, 8:02am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/7 "2021-07-15T08:02:51Z")

</div>

Hi @Deltakosh

sorry for my mistake, I have updated my PG: [https://playground.babylonjs.com/#EBPQH9#81](https://playground.babylonjs.com/#EBPQH9#81)  
and here, if you rotate the camera you can see the issue

 ![Screenshot 2021-07-15 at 08.59.28](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/a/5a7d6671eff6577165290fa003f543e815ba775c.png)

---

<div class="post-metadata">

**Author:** ![Arash\_Bagheri](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Arash\_Bagheri](https://forum.babylonjs.com/u/Arash_Bagheri)\
**Post date:** [July 15, 2021, 8:10am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/8 "2021-07-15T08:10:10Z")

</div>

Hi @Moriy  
Thanks a lot for answering to my question 🙏

so why should I call the \_updateFrustumPlanes?

---

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [July 15, 2021, 8:52am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/9 "2021-07-15T08:52:34Z")

</div>

Your issue is camera clipping. Near (minZ) is clipping the object. You can play with minZ like in the playground bellow (even though I am not sure it’s smart to use negative minZ value). Maybe it should be better to set minZ = 0, and make sure that you limit zoom to the object, so it cannot come near enough to clip the object.

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

If you don’t understand what’s camera frustum and clipping planes, you can check this, or read through ton of material on the internet.

> [@Camera goes through the meshs](https://forum.babylonjs.com/t/camera-goes-through-the-meshs/20408/2):
>
> Hi. The situation you are dealing with is connected to the camera frustum, and so called near and far clipping planes. If you worked in any 3D software you would experience same problem for the small object. Basically, your camera near plane is clipping the object. Here you can see the image representation of what I am talking about. You just have to set your near plane, so it doesn’t clip through the object. [https://playground.babylonjs.com/#TIYKC2#2](https://playground.babylonjs.com/#TIYKC2#2) (line 71)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 15, 2021, 2:28pm UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/10 "2021-07-15T14:28:25Z")

</div>

-z would work for the camera but a simpler trick is to position your meshes on z in front of the camera cause at the moment you are simulating being inside of it 🙂

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [July 16, 2021, 3:02am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/11 "2021-07-16T03:02:00Z")

</div>

oh my mistake. I thought about the question again, I find that move2DView function scales the size of camera Ortho, it seems that this camera go far aways from models, but actually the camera always stays at one place. firstly, you should set camera.maxZ big enough. secondly you should move camera far away from model when you change the ortho by move2DView.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/3/330071db01550a0015816f575d5d12485a3d0305.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/f/cf30ce25d60d72c8b00ab8419769e655a9ecbe47.png)

---

<div class="post-metadata">

**Author:** ![Moriy](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/moriy/32/30563_2.png) [@Moriy](https://forum.babylonjs.com/u/Moriy)\
**Post date:** [July 16, 2021, 3:28am UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/12 "2021-07-16T03:28:53Z")

</div>

I repro this question in unity, you can have a look to understand why this question happended.  
init state

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/9/49778c7663bdc7ca3249862f3d6a1766307bbfbe.jpeg)  
press q to far away (look like)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/e/5ea098ba8d1d5b5672b68171f87096415cdf1e03.jpeg)  
when you rotate camera, you can see mesh disappeared from front to back  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/3/f3b755a44ca4072c008725ff2938520f94e7b5bd.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/1/a1d3d3eaa77190920883b5ce4a4d1c357701a19f.jpeg)  
move camera back and change the maxZ  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/7/e70e5815dc165e9f098dfdc41dfe2447a6e64c1b.jpeg)  
normally again

---

<div class="post-metadata">

**Author:** ![Arash\_Bagheri](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Arash\_Bagheri](https://forum.babylonjs.com/u/Arash_Bagheri)\
**Post date:** [July 16, 2021, 2:23pm UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/13 "2021-07-16T14:23:46Z")

</div>

Hi @nogalo  
great. Thanks a lot for your explanation. 🙏🏻 🙏🏻 🙏🏻

---

<div class="post-metadata">

**Author:** ![Arash\_Bagheri](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Arash\_Bagheri](https://forum.babylonjs.com/u/Arash_Bagheri)\
**Post date:** [July 16, 2021, 2:24pm UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/14 "2021-07-16T14:24:36Z")

</div>

Hi @sebavan  
Thank you so much for your recommendation. 🙏 🙏

---

<div class="post-metadata">

**Author:** ![Arash\_Bagheri](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Arash\_Bagheri](https://forum.babylonjs.com/u/Arash_Bagheri)\
**Post date:** [July 16, 2021, 2:27pm UTC](https://forum.babylonjs.com/t/i-set-all-the-material-to-backfaceculling-false-but-when-i-panning-the-camera-my-meshes-cutting-and-go-to-vanish-how-can-i-solve-this-problem/22362/15 "2021-07-16T14:27:03Z")

</div>

Hi @Moriy

Thank you so much for all explanations and your time. 🙏 🙏

your explanation is so great. 🙏
