I tried the same model import from doc exmaple : https://www.babylonjs-playground.com/#1GFIVU#2
however, my camera seems zoom too much on target, here is my code:
}
appendModels(path:string,fileName:string | File,onSuccess?:()=>any){
SceneLoader.Append(path,fileName,this.scene,(a)=>{
onSuccess?onSuccess():
console.log('finished');
if(a.meshes.length){
// const worlExtends = a.getWorldExtends();
// let center = worlExtends.min.add(worlExtends.max).divideInPlace(Vector3.Zero());
(a.activeCamera as SuportedCamera).addBehavior(new AutoRotationBehavior());
a.createDefaultEnvironment({
createGround: true,
createSkybox: true,
enableGroundMirror: true,
groundMirrorSizeRatio: 0.2
});
// (a.activeCamera as SuportedCamera).setTarget(new Vector3(worlExtends.max._x+worlExtends.min._x,worlExtends.max._y+worlExtends.min._y,worlExtends.max._z+worlExtends.min._z))
}
},(data)=>{
console.log('onProgrocee',data);
},(err)=>{
console.log('onError',err);
})
}
my question is: is there a better way to set camera position to center model after every Append or Load Action