Amir2020

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi, I'm trying to get the width and height of the imported object in my scene, but I got this error. "Cannot read property 'getBoundingInfo' of undefined" and this is my code: var createScene = function(){ var scene = new BABYLON.Scene(engine); var camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 2, Math.PI / 2, 4, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); var front = BABYLON.SceneLoader.ImportMesh("", "model/", "front.glb", scene, function (meshes) { scene.createDefaultCameraOrLight(true, true, true); var light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 0, -50), this.scene); var light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(0, 1, -1), this.scene); scene.executeWhenReady(function () { var camera = new BABYLON.ArcRotateCamera("camera", -Math.PI/2.1, 1.2, 45, new BABYLON.Vector3(4.85, -8.01, 3.93), scene); camera.attachControl(canvas, true); scene.activeCamera = camera; engine.runRenderLoop(function() { scene.render(); }); }); }); scene.createDefaultLight(); scene.clearColor = new BABYLON.Color4(0,0,0,0.0000000000000001); scene.ambientColor = new BABYLON.Color3(1, 1, 1); var size = front[0].getBoundingInfo().boundingBox.extendSize; console.log(size); return scene; };