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

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.

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

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

1 Like

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

2 Likes

Hi @Deltakosh

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

Hi @Moriy
Thanks a lot for answering to my question :pray:

so why should I call the _updateFrustumPlanes?

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.

https://playground.babylonjs.com/#EBPQH9#83

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.

1 Like

-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 :slight_smile:

1 Like

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.


1 Like

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


press q to far away (look like)

when you rotate camera, you can see mesh disappeared from front to back


move camera back and change the maxZ

normally again

2 Likes

Hi @nogalo
great. Thanks a lot for your explanation. :pray:t2: :pray:t2: :pray:t2:

Hi @sebavan
Thank you so much for your recommendation. :pray: :pray:

Hi @Moriy

Thank you so much for all explanations and your time. :pray: :pray:

your explanation is so great. :pray: