If camera zoom in mesh, mesh not showing properly

Hi Team,

 I working on gltf or obj mesh. mesh load properly, but when camera zoom near by mesh then, mesh same part invisible.

this is zoom out view

this is mesh zoom in view

I am use base code for load mesh

this.canvas = (
document.getElementById(“renderModelCanvas”)
);
this.engine = new BABYLON.Engine(this.canvas, true);

this.scene = new BABYLON.Scene(this.engine);

this.camera = new BABYLON.ArcRotateCamera(“Camera”, 0, 0, 10, new BABYLON.Vector3(0, 0, 0), scene);

this.camera.attachControl();
this.camera.minZ = 0.15;
this.camera.speed = 0.01;
this.camera.wheelDeltaPercentage = 0.1;
this.camera.rotation = new Vector3(0.50, 1.30, 0)

const light = new BABYLON.HemisphericLight(“HemiLight”, new BABYLON.Vector3(0, 1, 0), this.scene);

BABYLON.SceneLoader.ImportMesh(
  "", "/assets/3D/",
  "Chiller plant_03.gltf",
  scene,
  function (newMeshes, particleSystems, skeletons) {
    let meshe: any;
    
    alert(newMeshes[0].position);

    for (meshe of newMeshes) {
      meshe.position = new Vector3(0, 0, 0);
      meshe.material.emissiveColor = { r: 1, g: 1, b: 1 };
      meshe.material.diffuseColor = { r: 255, g: 255, b: 255 };
      meshe.material.specularColor = { r: 255, g: 255, b: 255 };
    }
  }
  );

This is caused by the camera clipping through the mesh. You could avoid this happening by setting a lowerRadiusLimit on the camera: ArcRotateCamera | Babylon.js Documentation (babylonjs.com)

1 Like

Hi,

I change minZ then it is working

this.camera.minZ =0.01